[New-bugs-announce] [issue46949] Print an indication if traceback exceeds sys.tracebacklimit

Jelle Zijlstra report at bugs.python.org
Mon Mar 7 11:52:16 EST 2022


New submission from Jelle Zijlstra <jelle.zijlstra at gmail.com>:

If the number of frames in a traceback exceeds sys.tracebacklimit (which defaults to 1000), any remaining frames are silently dropped. See https://docs.python.org/3.10/library/sys.html#sys.tracebacklimit.

This is confusing to users. We should print some indication like "N additional stack frames not shown".

Here are some specific ideas:
- tracebacklimit <= 0 is documented as dropping the whole traceback. In that case, we don't need too print any message.
- It may be expensive to compute a complete count. Perhaps we can count frames up to 2 * tracebacklimit, and just say "Many additional stack frames not shown".
- The C implementation is in tb_print_internal() in traceback.c, and the Python one in _extract_from_extended_frame_gen in traceback.py.

----------
components: Interpreter Core
messages: 414674
nosy: Jelle Zijlstra, gvanrossum, iritkatriel
priority: normal
severity: normal
status: open
title: Print an indication if traceback exceeds sys.tracebacklimit
type: enhancement
versions: Python 3.11

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


More information about the New-bugs-announce mailing list