bpo-31327: Update time documentation to reflect possible errors by slateny · Pull Request #31460 · python/cpython (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation13 Commits3 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
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
https://bugs.python.org/issue31327
Automerge-Triggered-By: GH:pganssle
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with the CI fixes
@zooba Fixed trailing spaces, could you take another look?
the range of values supported by the platform C :c:func:`localtime` or |
---|
:c:func:`gmtime` functions, and :exc:`OSError` on :c:func:`localtime` or |
:c:func:`gmtime` failure. |
It's common for this to be restricted to years in |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's common for this to be restricted to years in |
---|
It's common for this to be restricted to years in the range of |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just copied-pasted from datetime
, but if we're to change the wording then there's some shorter options as well:
"... to be restricted to the years 1970 through 2038."
or
"... years in the range 1970 to 2038."
Though difficult for me to say which one of the three is the best here.
slateny changed the title
bpo-31327: Updated time documentation to reflect possible errors bpo-31327: Update time documentation to reflect possible errors
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @slateny for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9, 3.10.
🐍🍒⛏🤖
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
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
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
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
miss-islington added a commit that referenced this pull request
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
miss-islington added a commit that referenced this pull request
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
@pganssle Did you intend to add the backport to 3.8 label?
@iritkatriel It's a doc fix, not sure how far we usually backport those since they are not critical bit also not likely to cause any problems, so I went with backporting as far as it would go. If you think there's no reason to go that far back I don't feel strongly about it at all.
@iritkatriel It's a doc fix, not sure how far we usually backport those since they are not critical bit also not likely to cause any problems, so I went with backporting as far as it would go. If you think there's no reason to go that far back I don't feel strongly about it at all.
I don’t have a view on this (and I didn’t know we backport doc fixes to 3.8). In this particular case it seems like the 3.8 backport did not happen - maybe the bots don’t do them based on labels?
ambv pushed a commit that referenced this pull request
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
hello-adam pushed a commit to hello-adam/cpython that referenced this pull request
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