Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-102406: replace exception chaining by PEP-678 notes in codecs #102407

Merged
merged 7 commits into from
Mar 21, 2023

Conversation

iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Mar 3, 2023

Fixes #102406.

This replaces exception wrapping in codecs by PEP-678 notes.

Simplifies the code and removes the restrictions that prevent wrapping of exceptions that we cannot safely create copies of (because they have args or __init__ overrides, etc).

@iritkatriel iritkatriel added type-feature A feature request or enhancement interpreter-core (Objects, Python, Grammar, and Parser dirs) 3.12 bugs and security fixes labels Mar 3, 2023
@iritkatriel iritkatriel changed the title gh-102406: replace exception wrapping by PEP-678 notes gh-102406: replace exception wrapping by PEP-678 notes in codecs Mar 3, 2023
@iritkatriel
Copy link
Member Author

CC @Zac-HD

@iritkatriel iritkatriel requested a review from doerwalter March 3, 2023 22:59
@iritkatriel iritkatriel changed the title gh-102406: replace exception wrapping by PEP-678 notes in codecs gh-102406: replace exception chaining by PEP-678 notes in codecs Mar 3, 2023
@doerwalter
Copy link
Contributor

I'm not sure why wrapping of the codec errors was added in the first place. IMHO the encoding name and codec operation should be clear enough from the stacktrace.

However using exception notes for that is definitiely an improvement.

I fear that I can't review the patch in detail, as I'm no longer familiar with Python's C API.

@iritkatriel iritkatriel requested a review from ncoghlan March 7, 2023 20:58
@iritkatriel iritkatriel added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Mar 21, 2023
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @iritkatriel for commit af91411 🤖

If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Mar 21, 2023
@gpshead gpshead self-requested a review March 21, 2023 20:06
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Copy link
Member

@gpshead gpshead left a comment

Choose a reason for hiding this comment

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

Excellent cleanup!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

codecs can use PEP-678 notes instead of wrapping/chaining exceptions
5 participants