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-105375: Improve error handling in _Unpickler_SetInputStream()#105667

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

@erlend-aasland
Copy link
Contributor

@erlend-aaslanderlend-aasland commentedJun 11, 2023
edited by bedevere-bot
Loading

Prevent exceptions from possibly being overwritten in case of multiple
failures.

Prevent exceptions from possibly being overwritten in case of multiplefailures.
@erlend-aasland
Copy link
ContributorAuthor

@serhiy-storchaka, would you have time to look at this bugfix?

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think you missed the purpose_PyObject_LookupAttr(). It was designed to get rid ofPyErr_ExceptionMatches(PyExc_AttributeError) checks and the overhead of raising and catching an exception.

- There's no need to match AttributeError, since _PyObject_LookupAttr()  converts that exception into a return value of 0.- We can use the result output variable instead of adding temporary  boolean indicators.
There's no need for PyErr_Occurred() anymore
@erlend-aasland
Copy link
ContributorAuthor

Thanks for the very helpful review and historical insight, Serhiy.

@miss-islington
Copy link
Contributor

Thanks@erlend-aasland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

@erlend-aaslanderlend-aasland deleted the improve-pickle-error-handling branchJune 13, 2023 08:38
@bedevere-bot
Copy link

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

@bedevere-botbedevere-bot removed the needs backport to 3.12only security fixes labelJun 13, 2023
@bedevere-bot
Copy link

GH-105721 is a backport of this pull request to the3.11 branch.

erlend-aasland added a commit to erlend-aasland/cpython that referenced this pull requestJun 13, 2023
…Stream() (python#105667)Prevent exceptions from possibly being overwritten in case of multiplefailures.(cherry picked from commit217589d)Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
erlend-aasland added a commit to erlend-aasland/cpython that referenced this pull requestJun 13, 2023
…Stream() (python#105667)Prevent exceptions from possibly being overwritten in case of multiplefailures.(cherry picked from commit217589d)Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
@bedevere-botbedevere-bot removed the needs backport to 3.11only security fixes labelJun 13, 2023
erlend-aasland added a commit that referenced this pull requestJun 13, 2023
…() (#105667) (#105721)Prevent exceptions from possibly being overwritten in case of multiplefailures.(cherry picked from commit217589d)
erlend-aasland added a commit that referenced this pull requestJun 13, 2023
…() (#105667) (#105720)Prevent exceptions from possibly being overwritten in case of multiplefailures.(cherry picked from commit217589d)
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@serhiy-storchakaserhiy-storchakaserhiy-storchaka approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@erlend-aasland@miss-islington@bedevere-bot@serhiy-storchaka

[8]ページ先頭

©2009-2025 Movatter.jp