Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
gh-152212: Add STD-offset-required comment and tighten NEWS per review
  • Loading branch information
tonghuaroot committed Jun 27, 2026
commit aec9aea6c8a62f015044b1357385ee2bf0abff2e
1 change: 1 addition & 0 deletions Lib/zoneinfo/_zoneinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ def _parse_tz_str(tz_str):
except ValueError as e:
raise ValueError(f"Invalid STD offset in {tz_str}") from e
else:
# The STD offset is required
raise ValueError(f"Invalid STD offset in {tz_str}")
Comment thread
StanFromIreland marked this conversation as resolved.

if dst_abbr is not None:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
Fixed a parity bug in the pure-Python :mod:`zoneinfo` implementation, which
accepted a POSIX TZ footer whose ``std`` field had no offset (for example
``AAA``), silently building a fixed offset-0 zone. Such a string is invalid per
POSIX (the offset following ``std`` is required), and the C accelerator already
rejects it; the pure-Python parser now raises :exc:`ValueError` to match.
Patch by tonghuaroot.
Fix the pure-Python :mod:`zoneinfo` parser accepting a POSIX TZ string with a
``std`` abbreviation but no offset. This is invalid per POSIX and now
raises :exc:`ValueError`, matching the C accelerator. Patch by tonghuaroot.
Loading