Repository navigation
Conversation
Member
Author
|
Not sure who might want to review this, maybe @StanFromIreland or @serhiy-storchaka or @ZeroIntensity? |
serhiy-storchaka
self-requested a review
September 19, 2025 09:48
|
This PR is stale because it has been open for 30 days with no activity. |
Reject fold=2 before it can reach the transition array, and use the correct format specifier for the long fold value. Match the datetime year error message and use MAXYEAR for the upper bound. Add regression tests for invalid folds and years, conversion errors, and valid boundary values.
pganssle
force-pushed
the
zoneinfo_false_friends
branch
from
October 20, 2026 18:41
4e29a95 to
f6c77dd
Compare
StanFromIreland
approved these changes
Oct 23, 2026
StanFromIreland
left a comment
Member
There was a problem hiding this comment.
Few nits, otherwise LGTM.
| @@ -446,6 +447,52 @@ def __eq__(self, other): | |||
| class CZoneInfoTest(ZoneInfoTest): | |||
Member
There was a problem hiding this comment.
It would be nice to have the Python implementation consistent, but backporting that would be troublesome so that can be left to a follow up.
Member
Author
There was a problem hiding this comment.
The footprint is actually pretty small, so I included it here. If you don't think it's backportable I can move it to a new PR.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #125318.
I think this can be backported to bugfix branches, since it just prevents segfaults. It might make things slower in some situations for people who have "false friend" classes that happen to have the same memory layout as
datetimebut that is not really a supported mode of operation anyway, we're really just fixing this because you shouldn't be able to crash the interpreter from pure Python code.zoneinfowith custom DateTime class #125318