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-103791: handle `BaseExceptionGroup` in `contextlib.suppress()` by Zac-HD · Pull Request #111910 · python/cpython

Conversation

@Zac-HD

@Zac-HD Zac-HD commented Nov 9, 2023 •
edited by github-actions Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

As suggested by @iritkatriel in #103792 (comment).

  • Issue: contextlib.suppress does not support ExceptionGroups #103791

📚 Documentation preview 📚: https://cpython-previews--111910.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

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

All reactions
@Zac-HD
Zac-HD requested a review from 1st1 as a code owner November 9, 2023 18:51
@bedevere-app bedevere-app Bot added the awaiting review label Nov 9, 2023
@bedevere-app bedevere-app Bot mentioned this pull request Nov 9, 2023
contextlib.suppress does not support ExceptionGroups #103791
Closed
@Zac-HD Zac-HD mentioned this pull request Nov 9, 2023
Backport changes to contextlib.suppress()? agronholm/exceptiongroup#91
Closed
@gaogaotiantian

gaogaotiantian commented Nov 9, 2023

Copy link
Copy Markdown
Member

I don't think we are going to backport this. This is not a bug in 3.12 - it's doing what the docs says. So I believe the changeversion could be just 3.13.

All reactions

Sorry, something went wrong.

Uh oh!

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

@gaogaotiantian
gaogaotiantian requested a review from iritkatriel November 9, 2023 19:00
@Zac-HD

Zac-HD commented Nov 9, 2023

Copy link
Copy Markdown
Contributor Author

IMO it should be backported to 3.12.1: it seems likely that the missing support for BaseExceptionGroup was simply an oversight (@ambv might be able to confirm?), and it's much easier on users if we patch it promptly - the .0 versions aren't widely used.

All reactions

Sorry, something went wrong.

Uh oh!

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

iritkatriel
iritkatriel reviewed Nov 9, 2023
View reviewed changes
Comment thread Doc/library/contextlib.rst Resolved

Uh oh!

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

Comment thread Lib/test/test_contextlib.py Resolved

Uh oh!

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

@iritkatriel

iritkatriel commented Nov 9, 2023

Copy link
Copy Markdown
Member

IMO it should be backported to 3.12.1: it seems likely that the missing support for BaseExceptionGroup was simply an oversight (@ambv might be able to confirm?), and it's much easier on users if we patch it promptly - the .0 versions aren't widely used.

I'd call it a bug and backport.

AlexWaygood reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@iritkatriel iritkatriel added type-bug An unexpected behavior, bug, or error interpreter-core (Objects, Python, Grammar, and Parser dirs) needs backport to 3.12 only security fixes labels Nov 9, 2023
iritkatriel
iritkatriel reviewed Nov 9, 2023
View reviewed changes
Comment thread Doc/library/contextlib.rst Resolved

Uh oh!

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

@Zac-HD
handle BaseExceptionGroup in contextlib.suppress()
d90864e
@Zac-HD
Zac-HD force-pushed the zac-hd/suppress-baseexceptiongroup branch from 0dfe1a7 to bb4220c Compare November 10, 2023 04:40
@Zac-HD
address review comments
b8bc136
@Zac-HD
Zac-HD force-pushed the zac-hd/suppress-baseexceptiongroup branch from bb4220c to b8bc136 Compare November 10, 2023 04:59
iritkatriel
iritkatriel approved these changes Nov 10, 2023
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Nov 10, 2023
@iritkatriel
iritkatriel merged commit d61313b into python:main Nov 10, 2023
@miss-islington-app

miss-islington-app Bot commented Nov 10, 2023

Copy link
Copy Markdown

Thanks @Zac-HD for the PR, and @iritkatriel for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the awaiting merge label Nov 10, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 10, 2023
@Zac-HD @miss-islington
pythongh-103791: handle BaseExceptionGroup in `contextlib.suppress(…
9e2096d
…)` (pythonGH-111910)

(cherry picked from commit d61313b)

Co-authored-by: Zac Hatfield-Dodds <[email protected]>
@bedevere-app

bedevere-app Bot commented Nov 10, 2023

Copy link
Copy Markdown

GH-111955 is a backport of this pull request to the 3.12 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Nov 10, 2023
iritkatriel pushed a commit that referenced this pull request Nov 10, 2023
@miss-islington @Zac-HD
[3.12] gh-103791: handle BaseExceptionGroup in `contextlib.suppress…
3780414
…()` (GH-111910) (#111955)

gh-103791: handle `BaseExceptionGroup` in `contextlib.suppress()` (GH-111910)
(cherry picked from commit d61313b)

Co-authored-by: Zac Hatfield-Dodds <[email protected]>
@Zac-HD
Zac-HD deleted the zac-hd/suppress-baseexceptiongroup branch November 10, 2023 17:02
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
@Zac-HD @aisk
pythongh-103791: handle BaseExceptionGroup in `contextlib.suppress(…
a2535e0
…)` (python#111910)
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
@Zac-HD @Glyphack
pythongh-103791: handle BaseExceptionGroup in `contextlib.suppress(…
27cc8c8
…)` (python#111910)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@iritkatriel iritkatriel iritkatriel approved these changes
@1st1 1st1 Awaiting requested review from 1st1

Uh oh!

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

Assignees

No one assigned

Labels

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

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

3 participants

@Zac-HD @gaogaotiantian @iritkatriel
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.