Opened 2 years ago

Closed 18 months ago

Last modified 2 months ago

#29393 closed Bug (fixed)

Infinite loop in ExceptionReporter.get_traceback_frames()

Reported by: James Howe Owned by: Tim Graham <timograham@…>
Component: Error reporting Version: 2.0
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes 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 (7)

comment:1 Changed 2 years ago by James Howe

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

comment:2 Changed 2 years ago by Tim Graham

Can you please give code to reproduce the issue?

comment:3 Changed 2 years 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 2 years ago by Tim Graham

Summary: Infinite loop in ExceptionReporter.get_traceback_framesInfinite loop in ExceptionReporter.get_traceback_frames()
Triage Stage: UnreviewedAccepted

comment:5 Changed 18 months ago by Tim Graham

Has patch: set

comment:6 Changed 18 months ago by Tim Graham <timograham@…>

Owner: set to Tim Graham <timograham@…>
Resolution: fixed
Status: newclosed

In 3634560f:

Fixed #29393 -- Prevented infinite loop in ExceptionReporter.get_traceback_frames().

comment:7 Changed 2 months ago by Chris Jerdonek

I filed #31675, which is an enhancement related to this issue.

Note: See TracTickets for help on using tickets.
Back to Top