Skip to content

gh-157378: Fix SyntaxError.offset for "Non-UTF-8 code" error - #157412

Merged
pablogsal merged 2 commits into
python:mainfrom
ashm-dev:gh-157378
Sep 14, 2026
Merged

pablogsal merged 2 commits into
python:mainfrom
ashm-dev:gh-157378

Conversation

@ashm-dev

@ashm-dev ashm-dev commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

@pablogsal pablogsal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Thanks a lot for the PR!

@pablogsal
pablogsal enabled auto-merge (squash) September 13, 2026 13:53
@ashm-dev

Copy link
Copy Markdown
Contributor Author

@pablogsal Auto-merge is currently blocked because All required checks pass failed due to an unrelated TSan flake in test_memoryio. Could you please re-run the failed job or merge manually?

@ashm-dev
ashm-dev requested a review from pablogsal September 14, 2026 10:07
@pablogsal
pablogsal merged commit e66bec0 into python:main Sep 14, 2026
98 of 100 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @ashm-dev for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @ashm-dev and @pablogsal, I could not cleanly backport this to 3.15 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker e66bec09b722b8955d34f51f2c4b63793d59f9cf 3.15

@miss-islington-app

Copy link
Copy Markdown

Sorry, @ashm-dev and @pablogsal, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker e66bec09b722b8955d34f51f2c4b63793d59f9cf 3.13

@bedevere-app

bedevere-app Bot commented Sep 14, 2026

Copy link
Copy Markdown

GH-157489 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Sep 14, 2026
@ashm-dev
ashm-dev deleted the gh-157378 branch September 14, 2026 12:16
pablogsal pushed a commit that referenced this pull request Sep 14, 2026
…H-157412) (#157489)

gh-157378: Fix SyntaxError.offset for "Non-UTF-8 code" error (GH-157412)
(cherry picked from commit e66bec0)

Co-authored-by: Shamil <ashm.tech@proton.me>
@pablogsal

Copy link
Copy Markdown
Member

@ashm-dev can you backport it to 3.15 and 3.13 please? Follow #157412 (comment)

@ashm-dev

Copy link
Copy Markdown
Contributor Author

@pablogsal I tried, but it doesn't work as-is on either branch.

3.15 doesn't have gh-156894 yet (GH-156926 is still open). Without it the offsets there are already correct, and this patch would actually make them wrong (3 -> 4 for b'\xc3\xa9X\x80'). I'll backport right after GH-156926 lands.

3.13 never got gh-151461, so this error has no offset there at all, nothing to fix. I'd skip 3.13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs backport to 3.13 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants