[issue46949] Print an indication if traceback exceeds sys.tracebacklimit

2022-03-07 Thread Irit Katriel
Irit Katriel added the comment: Re what the limit means, it’s a bit messier than that, see issue38197. -- ___ Python tracker ___

[issue46949] Print an indication if traceback exceeds sys.tracebacklimit

2022-03-07 Thread Eric V. Smith
Eric V. Smith added the comment: If you go with the second idea, I'd say something like f"More than {2 * tracebacklimit} additional stack frames not shown". It seems handy to know the magnitude of the problem. -- nosy: +eric.smith ___ Python

[issue46949] Print an indication if traceback exceeds sys.tracebacklimit

2022-03-07 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: It skips the least recent frames: >>> def error(): 1 / 0 ... >>> def g(): error() ... >>> def f(): g() ... >>> sys.tracebacklimit = 2 >>> f() Traceback (most recent call last): File "", line 1, in g File "", line 1, in error ZeroDivisionError: division

[issue46949] Print an indication if traceback exceeds sys.tracebacklimit

2022-03-07 Thread Guido van Rossum
Guido van Rossum added the comment: There is general confusion as to which part of the traceback is truncated. If I have main() -> f() -> g() -> error(), and the limit is 2, does it print main() -> f(), or does it print g() -> error()? (I'm not even sure which would be more useful.) FWIW

[issue46949] Print an indication if traceback exceeds sys.tracebacklimit

2022-03-07 Thread Jelle Zijlstra
New submission from Jelle Zijlstra : 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