Skip to content

gh-159706: Fix pure-Python ZoneInfo.fromutc() fold detection for single-transition zones - #159828

Open
lazerg wants to merge 1 commit into
python:mainfrom
lazerg:fix-issue-159706
Open

lazerg wants to merge 1 commit into
python:mainfrom
lazerg:fix-issue-159706

Conversation

@lazerg

@lazerg lazerg commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

In the pure-Python fromutc(), a zone with exactly one transition takes the timestamp > self._trans_utc[-1] branch, which used self._ttinfos[-1] (the offset after the transition) as tti_prev. That made the shift zero, so times in the fold got fold=0. This uses self._tti_before like the C implementation does, and adds a test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant