...">

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

slateny

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

zooba

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

@slateny

@zooba Fixed trailing spaces, could you take another look?

akulakov

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 slateny changed the titlebpo-31327: Updated time documentation to reflect possible errors bpo-31327: Update time documentation to reflect possible errors

Mar 4, 2022

@pganssle

pganssle

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@miss-islington

Thanks @slateny for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9, 3.10.
🐍🍒⛏🤖

@bedevere-bot

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Mar 11, 2022

@slateny @miss-islington

…onGH-31460)

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

@bedevere-bot

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Mar 11, 2022

@slateny @miss-islington

…onGH-31460)

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

Mar 11, 2022

@miss-islington @slateny

…1460)

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

Mar 11, 2022

@miss-islington @slateny

…1460)

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

@iritkatriel

@pganssle Did you intend to add the backport to 3.8 label?

@pganssle

@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

@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

Mar 16, 2022

@miss-islington @slateny

…1460) (GH-31827)

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

Jun 2, 2022

…onGH-31460)

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