FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-159706: Fix pure-Python ZoneInfo.fromutc() fold detection for single-transition zones by lazerg · Pull Request #159828 · python/cpython · GitHub

Repository navigation

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 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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL