]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-31327: Update time documentation to reflect possible errors (GH-31460)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 11 Mar 2022 19:29:48 +0000 (11:29 -0800)
committerGitHub <noreply@github.com>
Fri, 11 Mar 2022 19:29:48 +0000 (11:29 -0800)
commitb35b36e106152245fe68880f4073fd99ec17f65d
treef76da39bedae274cb44630ba61291d69206b13e0
parent3bc801960655ea265599805eac24173164b511a6
bpo-31327: Update time documentation to reflect possible errors (GH-31460)

As per the comments, this mirrors the [datetime documentation](https://docs.python.org/3/library/datetime.htmlGH-datetime.datetime.fromtimestamp).

```
>>> import time
>>> time.localtime(999999999999999999999)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: timestamp out of range for platform time_t
>>> time.localtime(-3600)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 22] Invalid argument
```
(cherry picked from commit c83fc9c02c9846ec3a2d0123999c98e02f00b3f5)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
Doc/library/time.rst