]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-124188: Fix PyErr_ProgramTextObject() (GH-124189) (GH-124423)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 7 Oct 2024 21:23:49 +0000 (23:23 +0200)
committerGitHub <noreply@github.com>
Mon, 7 Oct 2024 21:23:49 +0000 (00:23 +0300)
commit03ae82d0d34649d1fcb755015aa567fe3978d4f9
tree0888310829453b8fd1fa40f1ec90899544271c41
parent167d8d2f072505a85c6db72fdaf4edffd6d17f3a
[3.13] gh-124188: Fix PyErr_ProgramTextObject() (GH-124189) (GH-124423)

* Detect source file encoding.
* Use the "replace" error handler even for UTF-8 (default) encoding.
* Remove the BOM.
* Fix detection of too long lines if they contain NUL.
* Return the head rather than the tail for truncated long lines.
(cherry picked from commit e2f710792b0418b8ca1ca3b8cdf39588c7268495)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/test/support/script_helper.py
Lib/test/test_compiler_codegen.py
Lib/test/test_eof.py
Lib/test/test_exceptions.py
Misc/NEWS.d/next/Core_and_Builtins/2024-09-17-22-06-01.gh-issue-124188.aFqNAB.rst [new file with mode: 0644]
Python/errors.c