-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-37642: Update max and min offset in datetime module #14878
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
Conversation
Misc/NEWS.d/next/Library/2019-07-21-20-59-31.bpo-37642.L61Bvy.rst
Outdated
Show resolved
Hide resolved
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
I have made the requested changes; please review again |
Thanks for making the requested changes! @pganssle: please review the changes made to this pull request. |
Looks like there is different implementation in max and min offset in min offset in C is cpython/Modules/_datetimemodule.c Line 6487 in 35b87e6
max offset in C is cpython/Modules/_datetimemodule.c Line 6496 in 35b87e6
Should I also update these? |
I think you should. A shorter way to write the new limits would be |
i was plan to use |
I commented recently on the bpo issue, but I think we should keep |
df9064b
to
717cccf
Compare
I have made the requested changes; please review again |
Thanks for making the requested changes! @pganssle: please review the changes made to this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh, I wrote this review yesterday and didn't realize I never submitted it.
Per this comment, I think we need to keep timezone.min
and timezone.max
the same for now. I would say to move the changes for timezone.min
and timezone.max
into another branch, but I think we need a new BPO issue for it because I think that needs more discussion.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Lib/test/datetimetester.py
Outdated
@@ -279,7 +280,7 @@ def test_constructor(self): | |||
tz = timezone(subminute) | |||
self.assertNotEqual(tz.utcoffset(None) % timedelta(minutes=1), 0) | |||
# invalid offsets | |||
for invalid in [timedelta(1, 1), timedelta(1)]: | |||
for invalid in [timedelta(1, 1), timedelta(days=1, microseconds=1)]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this need to be changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, looks like i forgot to restore it
717cccf
to
e7ca520
Compare
I have made the requested changes; please review again |
a29411b
to
cabad73
Compare
This fixes an inconsistency between the Python and C implementations of the datetime module. The pure python version of the code was not accepting offsets greater than 23:59 but less than 24:00. This is an accidental legacy of the original implementation, which was put in place before tzinfo allowed sub-minute time zone offsets. pythonGH-14878
cabad73
to
104ebe0
Compare
Sorry, @nsiregar and @pganssle, I could not cleanly backport this to |
Sorry @nsiregar and @pganssle, I had trouble checking out the |
GH-15226 is a backport of this pull request to the 3.7 branch. |
This fixes an inconsistency between the Python and C implementations of the datetime module. The pure python version of the code was not accepting offsets greater than 23:59 but less than 24:00. This is an accidental legacy of the original implementation, which was put in place before tzinfo allowed sub-minute time zone offsets. pythonGH-14878 (cherry picked from commit 92c7e30)
This fixes an inconsistency between the Python and C implementations of the datetime module. The pure python version of the code was not accepting offsets greater than 23:59 but less than 24:00. This is an accidental legacy of the original implementation, which was put in place before tzinfo allowed sub-minute time zone offsets. pythonGH-14878 (cherry picked from commit 92c7e30)
GH-15227 is a backport of this pull request to the 3.8 branch. |
This fixes an inconsistency between the Python and C implementations of the datetime module. The pure python version of the code was not accepting offsets greater than 23:59 but less than 24:00. This is an accidental legacy of the original implementation, which was put in place before tzinfo allowed sub-minute time zone offsets. GH-14878 (cherry picked from commit 92c7e30)
This fixes an inconsistency between the Python and C implementations of the datetime module. The pure python version of the code was not accepting offsets greater than 23:59 but less than 24:00. This is an accidental legacy of the original implementation, which was put in place before tzinfo allowed sub-minute time zone offsets. GH-14878 (cherry picked from commit 92c7e30)
This fixes an inconsistency between the Python and C implementations of the datetime module. The pure python version of the code was not accepting offsets greater than 23:59 but less than 24:00. This is an accidental legacy of the original implementation, which was put in place before tzinfo allowed sub-minute time zone offsets. pythonGH-14878
@@ -1881,3 +1881,4 @@ Aleksandr Balezin | |||
Robert Leenders | |||
Tim Hopper | |||
Dan Lidral-Porter | |||
Ngalim Siregar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that we don’t append to this file, but keep it sorted alphabetically by author last name.
This fixes an inconsistency between the Python and C implementations of the datetime module. The pure python version of the code was not accepting offsets greater than 23:59 but less than 24:00. This is an accidental legacy of the original implementation, which was put in place before tzinfo allowed sub-minute time zone offsets. pythonGH-14878
This fixes an inconsistency between the Python and C implementations of the datetime module. The pure python version of the code was not accepting offsets greater than 23:59 but less than 24:00. This is an accidental legacy of the original implementation, which was put in place before tzinfo allowed sub-minute time zone offsets. pythonGH-14878
Update max and min offset for
datetime.timezone
to closer 24:00https://bugs.python.org/issue37642