gh-157378: Fix SyntaxError.offset for "Non-UTF-8 code" error (#157412) · python/cpython@e66bec0 · GitHub
Skip to content

Commit e66bec0

Browse files
authored
gh-157378: Fix SyntaxError.offset for "Non-UTF-8 code" error (#157412)
1 parent b62380f commit e66bec0

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

Lib/test/test_exceptions.py

Lines changed: 10 additions & 0 deletions
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix ``SyntaxError.offset`` and ``SyntaxError.end_offset`` for the
2+
"Non-UTF-8 code starting with ..." error when a non-ASCII character precedes
3+
the invalid byte on the same line. Patch by Shamil Abdulaev.

Parser/tokenizer/helpers.c

Lines changed: 2 additions & 4 deletions

0 commit comments

Comments
 (0)