Skip to content

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

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 16, 2022

Conversation

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

…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 success ✅ .

@iritkatriel
Copy link
Member

@ambv I don't know what your view is on backporting doc enhancements to 3.8.

See also #31460 (comment)

@ambv ambv merged commit 4d8e08b into python:3.8 Mar 16, 2022
@miss-islington miss-islington deleted the backport-c83fc9c-3.8 branch March 16, 2022 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants