Opened 8 months ago

Last modified 8 months ago

#29393 new Bug

Infinite loop in ExceptionReporter.get_traceback_frames()

Reported by: James Howe Owned by:
Component: Error reporting Version: 2.0
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The following code generates a cause/context cycle (exc_value.__cause__.__context__ is exc_value):

except WrapperException as exc:
    raise exc.__cause__

The while exc_value loop then never terminates.

Change History (4)

comment:1 Changed 8 months ago by James Howe

A possible workaround would be available if PEP 415 (__suppress_context__) were respected.

comment:2 Changed 8 months ago by Tim Graham

Can you please give code to reproduce the issue?

comment:3 Changed 8 months ago by James Howe

In a view, with DEBUG = True.

    raise RuntimeError('outer') from RuntimeError('inner')
except RuntimeError as exc:
    raise exc.__cause__

comment:4 Changed 8 months ago by Tim Graham

Summary: Infinite loop in ExceptionReporter.get_traceback_framesInfinite loop in ExceptionReporter.get_traceback_frames()
Triage Stage: UnreviewedAccepted
Note: See TracTickets for help on using tickets.
Back to Top