Skip to content

[3.13] gh-156894: Fix the position of syntax errors which cover a range (GH-156901) - #156928

Merged
serhiy-storchaka merged 2 commits into
python:3.13from
serhiy-storchaka:backport-59a6913-3.13
Sep 4, 2026
Merged

[3.13] gh-156894: Fix the position of syntax errors which cover a range (GH-156901)#156928
serhiy-storchaka merged 2 commits into
python:3.13from
serhiy-storchaka:backport-59a6913-3.13

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

The callers of _PyTokenizer_syntaxerror_known_range() pass columns in bytes, but SyntaxError.offset and end_offset are columns in characters.
(cherry picked from commit 59a6913)

In 3.13 the error for incompatible string prefixes points at the string itself, not at the prefixes, so the expected positions of these test cases differ from the main branch.

Co-authored-by: Serhiy Storchaka storchaka@gmail.com

serhiy-storchaka and others added 2 commits September 4, 2026 14:18
pythonGH-156901)

The callers of _PyTokenizer_syntaxerror_known_range() pass columns in bytes,
but SyntaxError.offset and end_offset are columns in characters.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 59a6913)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant