Repository navigation
gh-162028: Fix the pure Python JSON decoder error position for invalid escapes - #162029
Merged
Merged
Conversation
…decoder The C decoder reports the position of the backslash. The pure Python decoder reported the position of the character after it.
aisk
approved these changes
Nov 16, 2026
|
Thanks @thejesh23 for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15. |
|
GH-162122 is a backport of this pull request to the 3.15 branch. |
|
GH-162123 is a backport of this pull request to the 3.14 branch. |
Member
|
Merged, thanks for your fix! Hopefully, the Python implementation is not used by default on Python (only if you manually disable the C extension). I backported your change to 3.14 and 3.15 stable branches. |
vstinner
pushed a commit
that referenced
this pull request
Nov 16, 2026
… invalid escapes (GH-162029) (#162122) gh-162028: Fix the pure Python JSON decoder error position for invalid escapes (GH-162029) The C decoder reports the position of the backslash. The pure Python decoder reported the position of the character after it. (cherry picked from commit 5e18bfc) Co-authored-by: Thejesh <thejesh36@gmail.com>
vstinner
pushed a commit
that referenced
this pull request
Nov 16, 2026
… invalid escapes (GH-162029) (#162123) gh-162028: Fix the pure Python JSON decoder error position for invalid escapes (GH-162029) The C decoder reports the position of the backslash. The pure Python decoder reported the position of the character after it. (cherry picked from commit 5e18bfc) Co-authored-by: Thejesh <thejesh36@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The pure Python decoder now reports the position of the backslash for an invalid
\escape, like the C decoder.Tested locally: