Commit 3f8955f
committed
gh-152847: Reject non-digit day-of-year in pure-Python zoneinfo POSIX TZ rules
The J and n day-of-year branches of _parse_dst_start_end() fell through to a
bare int(date), accepting input the C accelerator rejects (for example J1_0,
which int() reads as day 10, silently building a different zone). Guard the
branch with an re.ASCII digit match mirroring the C parser's
parse_digits(1, 3), so both implementations agree.1 parent 384abb7 commit 3f8955f
3 files changed
Lines changed: 26 additions & 0 deletions
File tree
- Lib
- test/test_zoneinfo
- zoneinfo
- Misc/NEWS.d/next/Library
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1111 | 1111 | | |
1112 | 1112 | | |
1113 | 1113 | | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
1114 | 1117 | | |
1115 | 1118 | | |
1116 | 1119 | | |
| |||
1209 | 1212 | | |
1210 | 1213 | | |
1211 | 1214 | | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
1212 | 1224 | | |
1213 | 1225 | | |
1214 | 1226 | | |
| |||
1248 | 1260 | | |
1249 | 1261 | | |
1250 | 1262 | | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
1251 | 1272 | | |
1252 | 1273 | | |
1253 | 1274 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
720 | 720 | | |
721 | 721 | | |
722 | 722 | | |
| 723 | + | |
| 724 | + | |
723 | 725 | | |
724 | 726 | | |
725 | 727 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments