]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-111942: Fix SystemError in the TextIOWrapper constructor (#112061)
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 14 Nov 2023 20:02:28 +0000 (22:02 +0200)
committerGitHub <noreply@github.com>
Tue, 14 Nov 2023 20:02:28 +0000 (20:02 +0000)
commit9302f05f9af07332c414b3c19003efd1b1763cf3
tree496fcbadb2abf8e0db779fa4e942fcfc9a91234c
parent0ff6368519ed7542ad8b443de01108690102420a
gh-111942: Fix SystemError in the TextIOWrapper constructor (#112061)

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