Repository navigation
Commit 49ff84b
committed
gh-158252: Match Unicode whitespace in the C strptime parser
Py_ISSPACE excludes ASCII separators U+001C through U+001F, which the
Python parser treats as whitespace. Consuming one as a literal can leave
a space for the next numeric field, changing how adjacent fields split.
Use Py_UNICODE_ISSPACE and add regression tests for all four public
entry points. These cases returned different dates or times before the
fix.1 parent 79115de commit 49ff84b
3 files changed
Lines changed: 36 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1281 | 1281 | | |
1282 | 1282 | | |
1283 | 1283 | | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
1284 | 1291 | | |
1285 | 1292 | | |
1286 | 1293 | | |
| |||
3202 | 3209 | | |
3203 | 3210 | | |
3204 | 3211 | | |
| 3212 | + | |
| 3213 | + | |
| 3214 | + | |
| 3215 | + | |
| 3216 | + | |
| 3217 | + | |
| 3218 | + | |
| 3219 | + | |
3205 | 3220 | | |
3206 | 3221 | | |
3207 | 3222 | | |
| |||
4435 | 4450 | | |
4436 | 4451 | | |
4437 | 4452 | | |
| 4453 | + | |
| 4454 | + | |
| 4455 | + | |
| 4456 | + | |
| 4457 | + | |
| 4458 | + | |
| 4459 | + | |
| 4460 | + | |
4438 | 4461 | | |
4439 | 4462 | | |
4440 | 4463 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
385 | 393 | | |
386 | 394 | | |
387 | 395 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
115 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
116 | 117 | | |
117 | 118 | | |
118 | | - | |
| 119 | + | |
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
123 | | - | |
| 124 | + | |
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
| |||
0 commit comments