[issue43656] TracebackException or StackSummary.extract with capture_locals=True fail to catch exceptions raised by repr() on value of frame local variable in FrameSummary.__init__.

Andrei Kulakov report at bugs.python.org
Thu Oct 21 10:04:34 EDT 2021


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

Martin: I was also thinking of adding a parameter to `extract()`. The issue I see is that it's still confusing and complicated for new students to understand the issue and find the parameter and understand why it's needed.

Joe: one important thing to note is that if an exception is caught and handled, it doesn't at all mean that unrelated exceptions from __repr__ can be silenced. Can we determine if they came from an initialized object or from object in the middle of initialization?

By the way, can you post a complete traceback that your students were getting? I would like to see how hard it is to tell from the traceback that a particular classes' __repr__ is at fault. If it's a long traceback please attach as a file..

----------

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


More information about the Python-bugs-list mailing list