-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
gh-141732: Fix ExceptionGroup repr changing when original exception sequence is mutated
#141736
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
Open
dr-carlos
wants to merge
39
commits into
python:main
Choose a base branch
from
dr-carlos:exception-group-repr
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+157
−13
Open
Changes from 27 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
b1afcb8
Use `self.exceptions` in `BaseExceptionGroup` repr by supporting cust…
dr-carlos 59bc3c7
Update `ExceptionGroup` tests for new repr and add mutation test
dr-carlos ca2d21d
Fix typo in test comment
dr-carlos 493ab01
Update docs for `BaseExceptionGroup` repr change
dr-carlos cd90d51
Add NEWS entry
dr-carlos 177b535
Update `ExceptionGroup` repr in `test_traceback`
dr-carlos af4f086
Revert "Update `ExceptionGroup` repr in `test_traceback`"
dr-carlos 72918ea
Update `ExceptionGroup` tests to no longer change the repr
dr-carlos b45402a
Store exceptions copy in `BaseExceptionGroup->excs_orig` and use in `…
dr-carlos 62d72a4
Revert "Update docs for `BaseExceptionGroup` repr change"
dr-carlos f93ae8f
Remove `BaseExceptionGroup->excs_orig` and reconstruct in `repr` instead
dr-carlos 56eefee
Ensure that the exceptions copy in `BaseExceptionGroup` repr is freed
dr-carlos 79dd615
Move `ExceptionGroup` repr tests into new function
dr-carlos e9fec3d
Use the exceptions tuple for all non-lists in `ExceptionGroup` repr
dr-carlos f5acfef
Test custom sequence's `ExceptionGroup` repr
dr-carlos 2fca592
Update code style in `exceptions.c`
dr-carlos 4885a6b
Update code style in `exceptions.c`
dr-carlos 4801399
Remove unused `name` variable with new `%Y` format
dr-carlos 1bcddeb
Revert "Remove unused `name` variable with new `%Y` format"
dr-carlos ccef7c5
Revert "Update code style in `exceptions.c`"
dr-carlos 9ca573e
Save repr of non-standard sequences in `BaseExceptionGroup` constructor
dr-carlos 9531fe9
Update tests for non-standard exceptions sequence in `ExceptionGroup`
dr-carlos 1da9238
Document implementation details for `ExceptionGroup` exception sequence
dr-carlos fcaf314
Update Misc/NEWS.d/next/Core_and_Builtins/2025-11-19-16-40-24.gh-issu…
iritkatriel 2c67e71
Merge branch 'main' into exception-group-repr
iritkatriel d962581
Reword 'optimum' to 'optimal' in `exceptions.rst`
dr-carlos ce39eec
Update NEWS Entry
dr-carlos 9211d01
Handle error on `__repr__` for exceptions sequence passed to `Excepti…
dr-carlos 737206a
Change grammar in `exceptions.c`
dr-carlos 8d17ef3
Update comment relating to `Py_XNewRef` in `BaseExceptionGroup_repr()`
dr-carlos 383af2f
Handle `PySequence_List()` and `PyObject_Repr()` errors in `BaseExcep…
dr-carlos 5353340
Conditionally use `Py_NewRef` in `BaseExceptionGroup_repr()`
dr-carlos 9997c01
Refactor `goto error` into `return NULL` within `BaseExceptionGroup_r…
dr-carlos 3cd38db
Test custom sequences which raise errors in the `ExceptionGroup()` co…
dr-carlos 5feb970
Fix formatting of if-else in `exceptions.c`
dr-carlos d7aec51
Simplify f-string to normal str in `test_exceptions_mutation()`
dr-carlos e21fad0
Remove unnecessary `_exceptions_str` member of `ExceptionGroup`
dr-carlos 79094f6
Fix if-else formatting in `exceptions.c`
dr-carlos b5fcfa7
Keep lines less than 80 chars
dr-carlos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
2 changes: 2 additions & 0 deletions
2
Misc/NEWS.d/next/Core_and_Builtins/2025-11-19-16-40-24.gh-issue-141732.PTetqp.rst
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Ensure the :meth:`~object.__repr__` for :exc:`ExceptionGroup` and :exc:`BaseExceptionGroup` does | ||
| not change when the exception sequence that was original passed in to its constructor is subsequently mutated. |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.