Deprecate TracebackException.exc_type · Issue #112332 · python/cpython (original) (raw)

TracebackException is supposed to be a printable snapshot of an exception. It is intended to be lightweight (release references to frames, etc) and easily serialised.

Since the exc_type field is causing issues for subinterpreters, I suggest we deprecate it and replace it with a snapshot of the type.

Until removed, we can have an arg to optionally not save it (which can be used by subinterpreters).

Linked PRs