[New-bugs-announce] [issue46949] Print an indication if traceback exceeds sys.tracebacklimit
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
nosy: Jelle Zijlstra, gvanrossum, iritkatriel
title: Print an indication if traceback exceeds sys.tracebacklimit
versions: Python 3.11
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce