#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

Description

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 (6)

comment:1 Changed 19 months ago by James Howe

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

comment:2 Changed 19 months ago by Tim Graham

Can you please give code to reproduce the issue?

comment:3 Changed 19 months ago by James Howe

In a view, with DEBUG = True.

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

comment:4 Changed 19 months ago by Tim Graham

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

comment:5 Changed 10 months ago by Tim Graham

Has patch: set

comment:6 Changed 10 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().

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