| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…rator in pure-Python zoneinfo
Co-authored-by: Stan Ulbrych <stan@python.org>
|
The POSIX spec isn't actually explicit here, and doesn’t provide a formal grammar, but this is clearly a regex-typo (and doesn’t really make much sense in practice to allow other separators). Additionally, it's consistent with the far more used C implementation. As such, 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, 3.14, 3.15. |
Sorry, something went wrong.
|
GH-152265 is a backport of this pull request to the 3.15 branch. |
Sorry, something went wrong.
|
GH-152266 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
|
GH-152267 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
|
Merged, thanks. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
The pure-Python zoneinfo parser accepted a POSIX TZ Mm.w.d transition rule whose third separator was not a period. Only the first separator is escaped in the regex (r"M(\d{1,2})\.(\d).(\d)"); the bare third . matches any single character, so for example EST5EDT,M3.2X0,M11.1.0 was accepted with X consumed as the separator. POSIX requires literal periods and the C accelerator already rejects these strings, so this is a pure-vs-C parity bug.
This escapes the third separator (\.) so the pure parser matches the C accelerator and POSIX. Every well-formed Mm.w.d rule and all bundled IANA zones still parse; only the previously-accepted malformed separators now raise ValueError.