-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Improving error message with trailing comma in json #113149
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
Labels
3.13
bugs and security fixes
stdlib
Python modules in the Lib dir
type-feature
A feature request or enhancement
Comments
You are welcome. Looks like it will work. Do you want to create a PR? A similar special case for a trailing comma can be added for parsing JSON array. |
serhiy-storchaka
pushed a commit
that referenced
this issue
Dec 17, 2023
ryan-duve
pushed a commit
to ryan-duve/cpython
that referenced
this issue
Dec 26, 2023
aisk
pushed a commit
to aisk/cpython
that referenced
this issue
Feb 11, 2024
Glyphack
pushed a commit
to Glyphack/cpython
that referenced
this issue
Sep 2, 2024
cjwatson
added a commit
to cjwatson/ionit
that referenced
this issue
Jan 12, 2025
The fix for python/cpython#113149 changed this error message. Closes: #1092519
bdrung
pushed a commit
to bdrung/ionit
that referenced
this issue
Jan 13, 2025
The fix for python/cpython#113149 changed this error message. Closes: #1092519
bdrung
pushed a commit
to bdrung/ionit
that referenced
this issue
Jan 13, 2025
The fix for python/cpython#113149 changed this error message. Closes: #1092519
cjwatson
added a commit
to cjwatson/ionit
that referenced
this issue
Jan 13, 2025
The fix for python/cpython#113149 changed this error message. Closes: #1092519
bdrung
pushed a commit
to bdrung/ionit
that referenced
this issue
Jan 13, 2025
The fix for python/cpython#113149 changed this error message. Closes: #1092519
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3.13
bugs and security fixes
stdlib
Python modules in the Lib dir
type-feature
A feature request or enhancement
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
The error is the trailing comma.
Initial pull proposal: #113047 but apparently this needs more attention than I can contribute.
The actual fix needs to be further down, possibly in line 206
cpython/Lib/json/decoder.py
Lines 199 to 208 in 25061f5
we already know that we have seen a comma, and can insert a more helpful error message in line 206.
at this location, the previous character must have been a comma (line 201). Whitespace has been removed, so this will also catch
,\n}
CPython versions tested on:
3.11
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: