← 返回首页
gh-103590: do not wrap a single exception raised from a try-except* by iritkatriel · Pull Request #103665 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

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

Provide feedback

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

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

gh-103590: do not wrap a single exception raised from a try-except*#103665

Merged
iritkatriel merged 10 commits into
python:mainfrom
iritkatriel:wrapping
Apr 27, 2023
Merged

gh-103590: do not wrap a single exception raised from a try-except*#103665
iritkatriel merged 10 commits into
python:mainfrom
iritkatriel:wrapping

Conversation

iritkatriel commented Apr 21, 2023
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

iritkatriel added type-bug An unexpected behavior, bug, or error interpreter-core (Objects, Python, Grammar, and Parser dirs) needs backport to 3.11 only security fixes labels Apr 21, 2023
iritkatriel requested a review from gvanrossum April 21, 2023 16:15
iritkatriel added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Apr 21, 2023

Copy link
Copy Markdown

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

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

bedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Apr 21, 2023
iritkatriel requested a review from ambv April 24, 2023 20:03

gvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Looking at the logic and the test changes I wonder if this is a good idea?

Copy link
Copy Markdown
Member Author

Looking at the logic and the test changes I wonder if this is a good idea?

The example on the issue looks pretty convincing: #103590 (comment)

iritkatriel removed the needs backport to 3.11 only security fixes label Apr 25, 2023

Copy link
Copy Markdown
Member

The example on the issue looks pretty convincing: #103590 (comment)

I find that comment a bit confusing, but a later comment by Carl is indeed convincing.

LGTM.

gvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

+1

Comment thread Doc/whatsnew/3.12.rst Outdated Show resolved Hide resolved
iritkatriel merged commit 63842bd into python:main Apr 27, 2023

Copy link
Copy Markdown
Member

Should this be backported to 3.11?

Copy link
Copy Markdown
Member Author

Should this be backported to 3.11?

I thought so, but then I got the impression that you and @ambv thought it shouldn't.

Copy link
Copy Markdown
Member

So I'm changing my mind, there can't be too much code out there that would be broken by this fix. What does @ambv think?

ambv commented May 2, 2023

Copy link
Copy Markdown
Contributor

This is a bug. I agree there is probably little code out there that will be affected by the difference.

However, it's somewhat of a subtle change so user code is unlikely to be tested against it, and if a difference is experienced, the error displayed might be surprising. I'm thinking: "it works on my local box but on CI there's an exception, both are 3.11". While we continue improving 3.11, some installations will be forever stuck at 3.11.1 or so.

But given 3.11's low adoption so far I tend to agree that backporting is probably harmless and ultimately more helpful.

Let's backport then. But let's also be explicit about the change in the docs then. 3.12 whatsnew suggests this change only made it to 3.12, we need to amend that with a mention like "also changed in 3.11.4", and mention this in the except-star docs for both releases.

Copy link
Copy Markdown
Member

Good plan. Thanks!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ExceptionGroup] Inconsistent raise inside except*

4 participants

Footer

© 2026 GitHub, Inc.