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-103590: do not wrap a single exception raised from a try-except* #103665

Merged
merged 10 commits into from
Apr 27, 2023

Conversation

iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Apr 21, 2023

@iritkatriel 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 iritkatriel requested a review from gvanrossum April 21, 2023 16:15
@iritkatriel iritkatriel added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Apr 21, 2023
@bedevere-bot
Copy link

🤖 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 bedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Apr 21, 2023
@iritkatriel iritkatriel requested a review from ambv April 24, 2023 20:03
Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

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

@iritkatriel
Copy link
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 iritkatriel removed the needs backport to 3.11 only security fixes label Apr 25, 2023
@gvanrossum
Copy link
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.

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

+1

@iritkatriel iritkatriel merged commit 63842bd into python:main Apr 27, 2023
@gvanrossum
Copy link
Member

Should this be backported to 3.11?

@iritkatriel
Copy link
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.

@gvanrossum
Copy link
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
Copy link
Contributor

ambv commented May 2, 2023

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.

@gvanrossum
Copy link
Member

Good plan. Thanks!

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