]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-96268: Fix loading invalid UTF-8 (#96270)
authorMichael Droettboom <mdboom@gmail.com>
Wed, 7 Sep 2022 21:23:54 +0000 (17:23 -0400)
committerGitHub <noreply@github.com>
Wed, 7 Sep 2022 21:23:54 +0000 (14:23 -0700)
commit8bc356a7dd50cbdb46d10b8c7e457832431f5d9e
tree9426a7c4149963ad5e85964a8a2ac3f6b7bf72cc
parent3e26de3c1f24bf0810eaaf7d75a4332775870e78
gh-96268: Fix loading invalid UTF-8 (#96270)

This makes tokenizer.c:valid_utf8 match stringlib/codecs.h:decode_utf8.

It also fixes an off-by-one error introduced in 3.10 for the line number when the tokenizer reports bad UTF8.
Lib/test/test_source_encoding.py
Misc/NEWS.d/next/Core and Builtins/2022-08-25-10-19-34.gh-issue-96268.AbYrLB.rst [new file with mode: 0644]
Parser/tokenizer.c