GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-102406: replace exception chaining by PEP-678 notes in codecs by iritkatriel · Pull Request #102407 · python/cpython

Conversation

@iritkatriel

@iritkatriel iritkatriel commented Mar 3, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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

  • Issue: codecs can use PEP-678 notes instead of wrapping/chaining exceptions #102406

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@iritkatriel
pythongh-102406: replace exception wrapping by PEP-678 notes
2d9ab21
@bedevere-bot bedevere-bot mentioned this pull request Mar 3, 2023
codecs can use PEP-678 notes instead of wrapping/chaining exceptions #102406
Closed
@bedevere-bot bedevere-bot added the awaiting core review label Mar 3, 2023
@iritkatriel iritkatriel added type-feature A feature request or enhancement interpreter-core (Objects, Python, Grammar, and Parser dirs) 3.12 only security fixes labels Mar 3, 2023
@iritkatriel
iritkatriel requested review from malemburg and markshannon March 3, 2023 22:56
@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

iritkatriel commented Mar 3, 2023

Copy link
Copy Markdown
Member Author

CC @Zac-HD

Zac-HD reacted with thumbs up emoji Zac-HD reacted with heart emoji Zac-HD reacted with rocket emoji
All reactions
  • 👍 1 reaction
  • ❤️ 1 reaction
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@iritkatriel
iritkatriel requested a review from doerwalter March 3, 2023 22:59
@iritkatriel
rename function
926872f
@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
@blurb-it
📜🤖 Added by blurb_it.
cd9c128
@iritkatriel
iritkatriel requested a review from serhiy-storchaka March 3, 2023 23:50
@iritkatriel iritkatriel mentioned this pull request Mar 6, 2023
gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives (in Objects/) #102218
Merged
@doerwalter

doerwalter commented Mar 7, 2023

Copy link
Copy Markdown
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 and malemburg reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@iritkatriel
iritkatriel requested a review from ncoghlan March 7, 2023 20:58
iritkatriel added 2 commits March 10, 2023 17:26
@iritkatriel
Merge remote-tracking branch 'upstream/main' into codecs-exc
cc25310
@iritkatriel
Merge remote-tracking branch 'upstream/main' into codecs-exc
af91411
@iritkatriel iritkatriel added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Mar 21, 2023
@bedevere-bot

bedevere-bot commented Mar 21, 2023

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Mar 21, 2023
erlend-aasland
erlend-aasland approved these changes Mar 21, 2023
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Mar 21, 2023
erlend-aasland
erlend-aasland reviewed Mar 21, 2023
View reviewed changes
Comment thread Misc/NEWS.d/next/Core and Builtins/2023-03-03-23-21-16.gh-issue-102406.XLqYO3.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@gpshead
gpshead self-requested a review March 21, 2023 20:06
@gpshead @erlend-aasland
ReSTify the NEWS.
a2601ff
Co-authored-by: Erlend E. Aasland <[email protected]>
gpshead
gpshead approved these changes Mar 21, 2023
View reviewed changes

@gpshead gpshead left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Excellent cleanup!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@iritkatriel
add null check, just in case
3f0f6a2
@iritkatriel
iritkatriel merged commit 76350e8 into python:main Mar 21, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label Mar 21, 2023
Fidget-Spinner pushed a commit to Fidget-Spinner/cpython that referenced this pull request Mar 27, 2023
@iritkatriel @Fidget-Spinner
pythongh-102406: replace exception chaining by PEP-678 notes in codecs (
43f13b9
python#102407)
@iritkatriel
iritkatriel deleted the codecs-exc branch April 3, 2023 17:44
@iritkatriel iritkatriel mentioned this pull request Apr 9, 2023
Make exception wrapping less intrusive for __set_name__ calls #77757
Closed
warsaw pushed a commit to warsaw/cpython that referenced this pull request Apr 11, 2023
@iritkatriel @warsaw
pythongh-102406: replace exception chaining by PEP-678 notes in codecs (
872ba04
python#102407)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@erlend-aasland erlend-aasland erlend-aasland approved these changes
@gpshead gpshead gpshead approved these changes
@markshannon markshannon Awaiting requested review from markshannon
@malemburg malemburg Awaiting requested review from malemburg
@doerwalter doerwalter Awaiting requested review from doerwalter
@serhiy-storchaka serhiy-storchaka Awaiting requested review from serhiy-storchaka
@ncoghlan ncoghlan Awaiting requested review from ncoghlan

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

3.12 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

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

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@iritkatriel @doerwalter @bedevere-bot @gpshead @erlend-aasland
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.