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

Add exceptiongroup support to third party projects #23

Open
agronholm opened this issue Aug 20, 2022 · 9 comments
Open

Add exceptiongroup support to third party projects #23

agronholm opened this issue Aug 20, 2022 · 9 comments

Comments

@agronholm
Copy link
Owner

As requested on python-trio/trio#2213, we should try to add exceptiongroup support to both IPython and Apport. This issue tracks all efforts to add exceptiongroup support to other projects.

IPython seems to use customized versions of format_exception() and format_exception_only(), so it's likely to need an update to display exception groups, even on Python 3.11.

Apport, on the other hand, uses format_exc() and print_exc() straight from the traceback module, so a conditional import might do the trick.

@agronholm
Copy link
Owner Author

As of 1.0.0rc9, other projects can now be made to support exception group formatting via this library.

@henryiii
Copy link

Is pytest such a library?

@agronholm
Copy link
Owner Author

I believe there are people already working to integrate exception groups to pytest.

@renefritze
Copy link

The hypothesis project had a number of PRs concerning the topic.

@henryiii
Copy link

The tip:

For now, you can use pytest's --tb=native flag to see the tracebacks for each sub-exception.

looks to be very useful for now. Ideally PyTest will start displaying exception groups and notes natively at some point.

@Zac-HD
Copy link
Contributor

Zac-HD commented Sep 2, 2023

Linking all the ecosystem issues and status I know of, so they're visible in one place:

@jakkdl
Copy link
Contributor

jakkdl commented Oct 26, 2023

@agronholm are you okay with adding/moving the apport excepthook we currently have in Trio over to exceptiongroup? I can report a bug and open PR in apport for adding exceptiongroup support, but as Zac above says exceptiongroup would also need to carry a workaround due to Ubuntu being very conservative in package versions and new apport releases would take approximately forever to trickle down to all end users.

@agronholm
Copy link
Owner Author

I'm okay with it as a workaround, so long as it doesn't affect anything else.

@jakkdl
Copy link
Contributor

jakkdl commented Nov 3, 2023

Apport looks like we'd report a bug to https://bugs.launchpad.net/apport and open a PR at https://github.com/canonical/apport; see python-trio/trio#2464 for links to Trio's current workaround

As of #88 there is now a workaround for apport, but I also opened https://bugs.launchpad.net/apport/+bug/2042672

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants