]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-124188: Fix PyErr_ProgramTextObject() (GH-124189)
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 24 Sep 2024 08:01:37 +0000 (11:01 +0300)
committerGitHub <noreply@github.com>
Tue, 24 Sep 2024 08:01:37 +0000 (11:01 +0300)
commite2f710792b0418b8ca1ca3b8cdf39588c7268495
tree5fa743b6be184b1384cea36bc58e591b4568f52e
parent3c83f9958c14cd62ad8951c53536f7788745b0ba
gh-124188: Fix PyErr_ProgramTextObject() (GH-124189)

* 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.
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