]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-63161: Fix PEP 263 support (GH-139481)
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 10 Oct 2025 12:51:19 +0000 (15:51 +0300)
committerGitHub <noreply@github.com>
Fri, 10 Oct 2025 12:51:19 +0000 (12:51 +0000)
commit5c942f11cdf5f9d7313200983fa0c58b3bc670a2
tree701fa56a979e444bca784a187fe5cd30989c3ad5
parentd0b18b19fa0ed73ce99e49751604f3e7d409b8ba
gh-63161: Fix PEP 263 support (GH-139481)

* 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.
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