]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-63161: Fix PEP 263 support (GH-139481) (GH-139898)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 19 Oct 2025 19:16:33 +0000 (21:16 +0200)
committerGitHub <noreply@github.com>
Sun, 19 Oct 2025 19:16:33 +0000 (19:16 +0000)
commit9ff705c6c59a7561b065639ebb07f3341083e869
treee5bdbebce89fba44665898dcc4b72a8cc25ecf90
parent69d263cfe1ecbbf957a1f05a23cbea70a3bf6582
[3.14] gh-63161: Fix PEP 263 support (GH-139481) (GH-139898)

* Support non-UTF-8 shebang and comments if non-UTF-8 encoding is specified.
* Detect decoding error in comments for UTF-8 encoding.
* Include the decoding error position for default encoding in SyntaxError.
(cherry picked from commit 5c942f11cdf5f9d7313200983fa0c58b3bc670a2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/test/test_exceptions.py
Lib/test/test_source_encoding.py
Misc/NEWS.d/next/Core_and_Builtins/2025-10-01-18-21-19.gh-issue-63161.ef1S6N.rst [new file with mode: 0644]
Parser/pegen_errors.c
Parser/tokenizer/file_tokenizer.c
Parser/tokenizer/helpers.c
Parser/tokenizer/helpers.h
Parser/tokenizer/readline_tokenizer.c
Parser/tokenizer/string_tokenizer.c