Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-111942: Fix SystemError in the TextIOWrapper constructor#112061

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commentedNov 14, 2023
edited by bedevere-appbot
Loading

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

@serhiy-storchakaserhiy-storchaka added type-crashA hard crash of the interpreter, possibly with a core dump needs backport to 3.11only security fixes needs backport to 3.12only security fixes labelsNov 14, 2023
In non-debug more the check for the "errors" argument is skipped,and then PyUnicode_AsUTF8() can fail, but its result was not checked.
@serhiy-storchakaserhiy-storchaka changed the titlegh-111942: Fix crash in the TextIOWrapper constructorgh-111942: Fix SystemError in the TextIOWrapper constructorNov 14, 2023
@serhiy-storchakaserhiy-storchaka added type-bugAn unexpected behavior, bug, or error and removed type-crashA hard crash of the interpreter, possibly with a core dump labelsNov 14, 2023
@vstinnervstinnerenabled auto-merge (squash)November 14, 2023 18:45
@vstinnervstinnerenabled auto-merge (squash)November 14, 2023 18:45
@vstinner
Copy link
Member

The previous change broke the Python workflow:#111976 (comment) This change should fix it.

@vstinnervstinner merged commit9302f05 intopython:mainNov 14, 2023
@miss-islington-app
Copy link

Thanks@serhiy-storchaka for the PR, and@vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry,@serhiy-storchaka and@vstinner, I could not cleanly backport this to3.11 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker 9302f05f9af07332c414b3c19003efd1b1763cf3 3.11

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestNov 14, 2023
…thonGH-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.(cherry picked from commit9302f05)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>Co-authored-by: Victor Stinner <vstinner@python.org>
@bedevere-app
Copy link

GH-112085 is a backport of this pull request to the3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12only security fixes labelNov 14, 2023
@brettcannon
Copy link
Member

@brettcannon
Copy link
Member

Nm, it looks like it's passing now on a different buildbot (not sure if the "changes" tab was somehow stale on the buildbot master and it misattributed the contributing PRs).

vstinner reacted with thumbs up emoji

@vstinner
Copy link
Member

Nm, it looks like it's passing now on a different buildbot (not sure if the "changes" tab was somehow stale on the buildbot master and it misattributed the contributing PRs).

Time to time, I check the [Build Properties] tab to get the Git commit number. Sometimes, tracking buildbots can be confusing.

brettcannon reacted with thumbs up emoji

@bedevere-app
Copy link

GH-112089 is a backport of this pull request to the3.12 branch.

vstinner added a commit to vstinner/cpython that referenced this pull requestNov 14, 2023
…thon#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>(cherry picked from commit9302f05)
vstinner added a commit to vstinner/cpython that referenced this pull requestNov 14, 2023
…thon#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>(cherry picked from commit9302f05)
@serhiy-storchakaserhiy-storchaka deleted the TextIOWrapper-init-crash branchNovember 15, 2023 08:48
@serhiy-storchaka
Copy link
MemberAuthor

I suggest to reject embedded null characters:

I planned to do this in the following PR. This PR cannot be automatically backported with these changes. Do you mind to create backports manually?

@vstinner
Copy link
Member

I planned to do this in the following PR. This PR cannot be automatically backported with these changes. Do you mind to create backports manually?

I wrote PR#112089 for Python 3.12 usingPyUnicode_AsUTF8AndSize() andstrlen(). Would you mind to review it?

Then Python 3.11 can get the first change directly with the second fix (merged as a single PR).

serhiy-storchaka added a commit that referenced this pull requestNov 15, 2023
…H-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 commit9302f05)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit to miss-islington/cpython that referenced this pull requestNov 15, 2023
…tor (pythonGH-112061) (pythonGH-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 commit9302f05)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@serhiy-storchakaserhiy-storchaka removed the needs backport to 3.11only security fixes labelNov 15, 2023
aisk pushed a commit to aisk/cpython that referenced this pull requestFeb 11, 2024
…thon#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>
Glyphack pushed a commit to Glyphack/cpython that referenced this pull requestSep 2, 2024
…thon#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>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@vstinnervstinnervstinner left review comments

Assignees

@vstinnervstinner

Labels
type-bugAn unexpected behavior, bug, or error
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@serhiy-storchaka@vstinner@brettcannon

[8]ページ先頭

©2009-2025 Movatter.jp