]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-111942: Fix SystemError in the TextIOWrapper constructor (GH-112061) (GH...
authorVictor Stinner <vstinner@python.org>
Wed, 15 Nov 2023 13:55:46 +0000 (14:55 +0100)
committerGitHub <noreply@github.com>
Wed, 15 Nov 2023 13:55:46 +0000 (15:55 +0200)
commit1445d77282f9082f3fecde772ddf6bb2f5a383f1
tree0c94d2b0777b2f9c67c6debc5c3cdc3b63a58fdc
parent91a33fde4826967aa929e53a234aff8a419c5166
[3.12] gh-111942: Fix SystemError in the TextIOWrapper constructor (GH-112061) (GH-112089)

In non-debug more the check for the "errors" argument is skipped,
and then PyUnicode_AsUTF8() can fail, but its result was not checked.

Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit 9302f05f9af07332c414b3c19003efd1b1763cf3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/test/test_io.py
Misc/NEWS.d/next/Library/2023-11-14-18-43-55.gh-issue-111942.x1pnrj.rst [new file with mode: 0644]
Modules/_io/textio.c