Commit 53edfd8
committed
gh-59598: Ignore leading whitespace in JSONDecoder.raw_decode
raw_decode now ignores leading whitespace before the JSON value,
matching the behavior of decode(). Previously, passing a string like
' {}' to raw_decode would raise JSONDecodeError.
The fix uses the existing WHITESPACE regex to skip whitespace at
any offset, preserving correct behavior with the idx parameter.1 parent cfe3e07 commit 53edfd8
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
358 | | - | |
| 358 | + | |
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
364 | | - | |
| 364 | + | |
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
374 | | - | |
| 374 | + | |
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
0 commit comments