]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-63161: Fix tokenize.detect_encoding() (GH-139446) (GH-140378)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 20 Oct 2025 17:34:56 +0000 (19:34 +0200)
committerGitHub <noreply@github.com>
Mon, 20 Oct 2025 17:34:56 +0000 (17:34 +0000)
commit8e93f6e203bd6cd2f22ec238442f82f52b354289
treec86bada236fa7144b52c5c294976b1ff7fcedad9
parentabb3b3142b2ac25e034a1d52fcb08f8b71b1e023
[3.14] gh-63161: Fix tokenize.detect_encoding() (GH-139446) (GH-140378)

* Support non-UTF-8 shebang and comments if non-UTF-8 encoding is specified.
* Detect decoding error for non-UTF-8 encoding.
* Detect null bytes in source code.
(cherry picked from commit 38d4b436ca767351db834189b3a5379406cd52a8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/test/test_tokenize.py
Lib/tokenize.py
Misc/NEWS.d/next/Library/2025-09-30-12-52-54.gh-issue-63161.mECM1A.rst [new file with mode: 0644]