[Python-Dev] Reference cycles in Exception.__traceback__

Eric Snow ericsnowcurrently at gmail.com
Wed Mar 5 23:17:07 CET 2014


On Wed, Mar 5, 2014 at 2:54 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> Guido had a fix in mind - splitting traceback formatting into two pieces.
> The first would convert a traceback to a sequence of named tuples, the
> second would do the actual string formatting.

+1

This is basically how I've handled pickling tracebacks in a project at
work (using 2.7).  You can already using extract_tb() and
format_list() from the traceback module to get the effect.

As to how to use this to avoid holding those references (without
taking a performance hit), that will take some more thought.  :)

-eric


More information about the Python-Dev mailing list