Skip to content

Use PEP 654 ExceptionGroup for autosummary import errors#14075

Merged
AA-Turner merged 6 commits intosphinx-doc:masterfrom
flying-sheep:pa/exc-group
Nov 24, 2025
Merged

Use PEP 654 ExceptionGroup for autosummary import errors#14075
AA-Turner merged 6 commits intosphinx-doc:masterfrom
flying-sheep:pa/exc-group

Conversation

@flying-sheep
Copy link
Copy Markdown
Contributor

@flying-sheep flying-sheep commented Nov 20, 2025

Purpose

Since the MRPV is 3.11, we can just use the BaseExceptionGroup class as base class for the ImportExceptionGroup, which will result in much more context being included in the traceback.

This allows people to more easily debug why autosummary fails when it does.

References

@AA-Turner
Copy link
Copy Markdown
Member

@flying-sheep thanks for the PR! Tests are failing, please can you also add a changed entry?

A

@flying-sheep
Copy link
Copy Markdown
Contributor Author

flying-sheep commented Nov 21, 2025

All done! I’m excited, this was one of my first big usability issues with Sphinx, and soon it’ll be gone forever!

@flying-sheep flying-sheep changed the title fix: use exception group fix: use exception group for autosummary import errors Nov 21, 2025
@AA-Turner AA-Turner changed the title fix: use exception group for autosummary import errors Use PEP 654 ExceptionGroup for autosummary import errors Nov 24, 2025
@AA-Turner
Copy link
Copy Markdown
Member

Thanks!

A

@AA-Turner AA-Turner merged commit 0bdfa74 into sphinx-doc:master Nov 24, 2025
30 checks passed
@AA-Turner AA-Turner added this to the 9.0.0 milestone Nov 25, 2025
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Dec 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Autosummary import exception message is misleading and missing context

2 participants