-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
While reviewing #125652 and reading the documentation of int()
, I realised this condition in json.decoder
is insufficient:
Line 61 in f203d1c
if len(esc) == 4 and esc[1] not in 'xX': |
>>> import sys
>>> sys.modules["_json"] = None
>>> import json
>>> json.loads(r'["\u 000", "\u-000", "\u+000", "\u0_00"]')
['\x00', '\x00', '\x00', '\x00']
CPython versions tested on:
3.13
Operating systems tested on:
macOS
Linked PRs
- gh-125660: Python implementation of
json.loads()
accepts invalid unicode escapes #125683 - [3.13] gh-125660: Reject invalid unicode escapes for Python implementation of JSON decoder (GH-125683) #125694
- [3.12] gh-125660: Reject invalid unicode escapes for Python implementation of JSON decoder (GH-125683) #125695
Metadata
Metadata
Assignees
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
Done