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:
raise Exception()
except Exception as e:
raise e from e
Minimal example 2:
try:
e = Exception()
raise e from e
except Exception as e:
raise e
Identified Cause
Self-references are not checked while unwinding the chained exception on line 216 of result.py
Your environment
- CPython versions tested on: 3.9, 3.10
- Operating system and architecture: macOS
Linked PRs
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:
Minimal example 2:
Identified Cause
Self-references are not checked while unwinding the chained exception on line 216 of result.py
Your environment
Linked PRs