]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-124188: Fix PyErr_ProgramTextObject() (GH-124189) (GH-124426)
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 24 Sep 2024 08:53:54 +0000 (11:53 +0300)
committerGitHub <noreply@github.com>
Tue, 24 Sep 2024 08:53:54 +0000 (08:53 +0000)
commit18542240c26cea2b5e0372b668a5e67bd9015379
tree1861d734c619e62fefaccb4f65114df9240b62ed
parent7e2d414a599782773f46eb8a20506db0cfa3dcce
[3.12] gh-124188: Fix PyErr_ProgramTextObject() (GH-124189) (GH-124426)

* 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)
Lib/test/support/script_helper.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