Skip to content

gh-152248: Fix zoneinfo TZ string regex to only accept ASCII letters#152510

Closed
factnn wants to merge 1 commit into
python:mainfrom
factnn:fix/zoneinfo-tz-posix-regex
Closed

gh-152248: Fix zoneinfo TZ string regex to only accept ASCII letters#152510
factnn wants to merge 1 commit into
python:mainfrom
factnn:fix/zoneinfo-tz-posix-regex

Conversation

@factnn

@factnn factnn commented Jun 28, 2026

Copy link
Copy Markdown

Fixes #152248

The pure-Python _parse_tz_str regex used [^<0-9:.+-]+ for
unquoted abbreviations, which matched whitespace and non-ASCII
characters. The C implementation only accepts ASCII letters.

Tighten the regex to [a-zA-Z]+ to match C behavior.

…tters

The pure-Python _parse_tz_str regex used [^<0-9:.+-]+ for unquoted
abbreviations, which matched whitespace and non-ASCII characters.
The C implementation only accepts ASCII letters. Tighten the regex
to [a-zA-Z]+ to match C behavior.
@StanFromIreland

Copy link
Copy Markdown
Member

This already has an open PR, closing in favour of it: #152249

@factnn

factnn commented Jun 28, 2026

Copy link
Copy Markdown
Author

didn't notice #152249 — closing as duplicate, thanks.

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.

zoneinfo: pure-Python POSIX TZ unquoted abbreviation regex accepts whitespace or non-ASCII letters (C rejects)

2 participants