| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…n pure-Python zoneinfo The pure-Python _parse_tz_str defaulted a missing std offset to 0, so a POSIX TZ footer with a bare std abbreviation and no offset (e.g. 'AAA') was silently accepted as a fixed offset-0 zone. POSIX requires the offset after std, and the C accelerator already rejects it, so the pure-Python parser now raises ValueError to match.
| "PST8PDT", # DST but no transition specified | ||
| # gh-152212: the std offset is required (POSIX TZ grammar) | ||
| "AAA", | ||
| "A", |
There was a problem hiding this comment.
I was going to say these are rejected for another reason, i.e. because of the spec's required length:
three byte minimum length
But of course, we don't enforce that. However, I'm also not sure if this is just part of the 2024 updated spec, and I don't have time to check right now. I'll put this on my to-do list.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
|
Thanks @tonghuaroot for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Sorry, something went wrong.
|
Thanks @tonghuaroot for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Sorry, something went wrong.
|
Thanks @tonghuaroot for the PR, and @StanFromIreland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15. |
Sorry, something went wrong.
|
GH-152377 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
|
GH-152378 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
|
GH-152379 is a backport of this pull request to the 3.15 branch. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
The pure-Python zoneinfo._parse_tz_str defaults a missing std offset to 0 (else: std_offset = 0), so a POSIX TZ footer with a bare std abbreviation and no offset (AAA, A, AA, B) is silently accepted as a fixed offset-0 zone. POSIX requires the offset after std (Issue 8 §8.3), and the C accelerator already raises ValueError: Invalid STD offset, so this makes the pure-Python parser raise to match.
Adds AAA/A/AA/B to test_invalid_tzstr, which runs against both TZStrTest (pure) and CTZStrTest (C). Non-breaking: all 598 IANA zones still parse, and well-formed strings (EST5, <ABC>5, AAA5) are unaffected.
Fixes #152212.