SIGN IN SIGN UP

[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>
M
Miss Islington (bot) committed
8e93f6e203bd6cd2f22ec238442f82f52b354289
Parent: abb3b31
Committed by GitHub <noreply@github.com> on 10/20/2025, 5:34:56 PM