-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python implementation of json.loads()
accepts non-ascii digits
#125682
Comments
Why is this a bug? >>> int("\uff10")
0
>>> float("0e\uff10")
0.0 Arguably, the bug is that the C implementation does not support it. |
This can indeed be considered a bug, since it does not conform to the JSON specification in the standards. See, for example, Section 6: Numbers in IETF RFC 8259, which clearly defines the supported digits. |
Ah, I've applied the appropriate labels. Thank you for clarification :) |
json.loads()
accepts unicode digitsjson.loads()
accepts non-ascii digits
serhiy-storchaka
pushed a commit
that referenced
this issue
Oct 18, 2024
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Oct 18, 2024
… of JSON decoder (pythonGH-125687) (cherry picked from commit d358425) Co-authored-by: Nice Zombies <[email protected]>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Oct 18, 2024
… of JSON decoder (pythonGH-125687) (cherry picked from commit d358425) Co-authored-by: Nice Zombies <[email protected]>
Good spot! |
serhiy-storchaka
pushed a commit
that referenced
this issue
Oct 21, 2024
…n of JSON decoder (GH-125687) (GH-125693) (cherry picked from commit d358425) Co-authored-by: Nice Zombies <[email protected]>
serhiy-storchaka
pushed a commit
that referenced
this issue
Oct 21, 2024
…n of JSON decoder (GH-125687) (GH-125692) (cherry picked from commit d358425) Co-authored-by: Nice Zombies <[email protected]>
ebonnal
pushed a commit
to ebonnal/cpython
that referenced
this issue
Jan 12, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
Bug description:
You should be careful when matching unicode regexes:
cpython/Lib/json/scanner.py
Lines 11 to 13 in a0f5c8e
I think it's safer to use
[0-9]
instead of\d
here.CPython versions tested on:
3.13
Operating systems tested on:
macOS
Linked PRs
json.loads()
accepts non-ascii digits #125687The text was updated successfully, but these errors were encountered: