[issue42482] TracebackException should not hold reference to the exception traceback

STINNER Victor report at bugs.python.org
Fri Nov 27 14:31:00 EST 2020


STINNER Victor <vstinner at python.org> added the comment:

I consider PR 23531 change as a bugfix and IMO it's fine to backport it.

TracebackException docstring is quite explicit:

    The traceback module captures enough attributes from the original exception
    to this intermediary form to ensure that no references are held, while
    still being able to fully print or format it.

This issue shows that there was a bug in the implementation.

--

The unit test should check the ref count of the exception and the exception traceback, to check functionally that no strong reference is hold.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42482>
_______________________________________


More information about the Python-bugs-list mailing list