Improving error message with trailing comma in json #113149
Labels
3.13
new features, bugs and security fixes
stdlib
Python modules in the Lib dir
type-feature
A feature request or enhancement
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: