Skip to content

[3.10] bpo-31327: Update time documentation to reflect possible errors (GH-31460)#31825

Merged
miss-islington merged 1 commit into
python:3.10from
miss-islington:backport-c83fc9c-3.10
Mar 11, 2022
Merged

[3.10] bpo-31327: Update time documentation to reflect possible errors (GH-31460)#31825
miss-islington merged 1 commit into
python:3.10from
miss-islington:backport-c83fc9c-3.10

Conversation

@miss-islington

@miss-islington miss-islington commented Mar 11, 2022

Copy link
Copy Markdown
Contributor

As per the comments, this mirrors the datetime documentation.

>>> 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 c83fc9c)

Co-authored-by: slateny 46876382+slateny@users.noreply.github.com

https://bugs.python.org/issue31327

…onGH-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 c83fc9c)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
@miss-islington

Copy link
Copy Markdown
Contributor Author

@slateny: Status check is done, and it's a failure ❌ .

@miss-islington

Copy link
Copy Markdown
Contributor Author

@slateny: Status check is done, and it's a success ✅ .

@miss-islington

Copy link
Copy Markdown
Contributor Author

@slateny: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit b35b36e into python:3.10 Mar 11, 2022
@miss-islington miss-islington deleted the backport-c83fc9c-3.10 branch March 11, 2022 19:29
@miss-islington

Copy link
Copy Markdown
Contributor Author

@slateny: Status check is done, and it's a success ✅ .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants