Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
Closed
Description
Bug report
If an exception is raised with a self-referencing __cause__ or __context__ then TestResult._clean_tracebacks() in result.py enters an infinite loop.
Minimal example 1:
try:raiseException()exceptExceptionase:raiseefrome
Minimal example 2:
try:e=Exception()raiseefromeexceptExceptionase:raisee
Identified Cause
Self-references are not checked while unwinding the chained exceptionon line 216 of result.py
Your environment
- CPython versions tested on: 3.9, 3.10
- Operating system and architecture: macOS
Linked PRs
- gh-98458: unittest: bugfix for infinite loop while handling chained exceptions that contain cycles #98459
- [3.11] gh-98458: unittest: bugfix for infinite loop while handling chained exceptions that contain cycles (GH-98459) #99995
- [3.10] gh-98458: unittest: bugfix for infinite loop while handling chained exceptions that contain cycles (GH-98459) #99996