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

[3.14] gh-152246: Fix pure-Python `zoneinfo` accepting invalid seperators in POSIX TZ rules (GH-152247) by miss-islington · Pull Request #152266 · python/cpython · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) .rst  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
5 changes: 5 additions & 0 deletions Lib/test/test_zoneinfo/test_zoneinfo.py
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
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,11 @@ def test_invalid_tzstr(self):
# Invalid weekday
"AAA4BBB,M1.1.7/2,M2.1.1/2",
"AAA4BBB,M1.1.1/2,M2.1.7/2",
# Invalid Mm.w.d separator
"AAA4BBB,M3.2X0,M11.1.0",
"AAA4BBB,M3.2.0,M11.1X0",
"AAA4BBB,M3.2-0,M11.1.0/3",
"AAA4BBB,M3.2.0/2,M11.1:0",
# Invalid numeric offset
"AAA4BBB,-1/2,20/2",
"AAA4BBB,1/2,-1/2",
Expand Down
2 changes: 1 addition & 1 deletion Lib/zoneinfo/_zoneinfo.py
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
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ def _parse_dst_start_end(dststr):
type = date[:1]
if type == "M":
n_is_julian = False
m = re.fullmatch(r"M(\d{1,2})\.(\d).(\d)", date, re.ASCII)
m = re.fullmatch(r"M(\d{1,2})\.(\d)\.(\d)", date, re.ASCII)
if m is None:
raise ValueError(f"Invalid dst start/end date: {dststr}")
date_offset = tuple(map(int, m.groups()))
Expand Down
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix the pure-Python :mod:`zoneinfo` parser accepting an invalid POSIX TZ
transition rule with a non-period separator. Patch by tonghuaroot.
Loading

Back | FazBrowse Home | New Git URL