Commit b1b38d8
committed
gh-59598: Strip leading whitespace in JSONDecoder.raw_decode
raw_decode currently ignores leading whitespace before JSON values,
raising JSONDecodeError on strings like ' {"key": "value"}'. This is
inconsistent with JSONDecoder.decode() which handles leading whitespace.
Add s = s.lstrip() at the start of raw_decode to strip leading
whitespace before decoding, matching the behavior of decode().1 parent cfe3e07 commit b1b38d8
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
| 373 | + | |
| 374 | + | |
373 | 375 | | |
374 | 376 | | |
375 | 377 | | |
| |||
0 commit comments