Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2022

Conversation

miss-islington
Copy link
Contributor

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

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 [email protected]

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 <[email protected]>
@miss-islington
Copy link
Contributor Author

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

@miss-islington
Copy link
Contributor Author

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

@miss-islington
Copy link
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
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