-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Python implementation of traceback limit does not default to 1000 as documented in 3.13 #123596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Nice find! When fixing you need to be careful not to change the behavior for existing explicit users of the traceback module. The traceback module has a special sentinel that is passed for 'builtin' traceback formatting, look for |
Are you still studying the problem? If you are ready to submit, maybe I will close my submission. Be sorry.:) |
I went with the |
I have fixed the C code regarding the |
I have closed the PR for |
@blhsing Are you still working on it? If you are done, you can submit a PR. My PR is waiting for your submission before it can be merged. |
Bug report
Bug description:
According to the documentation of
sys.tracebacklimit
, it should default to 1000 if not set, so the following snippet:produces a traceback of 1000 frames as expected in 3.12:
But in 3.13 and the current master, it produces a traceback of all 2000 frames:
This is because with issue #110721, traceback is now printed with the traceback module by default, and the traceback module defaults
sys.tracebacklimit
toNone
when not set:cpython/Lib/traceback.py
Line 458 in c3ed775
whereas the C implementation of the traceback printer has a proper default of 1000 for
sys.tracebacklimit
as documented:cpython/Python/traceback.c
Line 707 in c3ed775
I will submit a PR to make 1000 the default value for
sys.tracebacklimit
in the Python implementation of the traceback module.CPython versions tested on:
3.13, CPython main branch
Operating systems tested on:
Linux, Windows
Linked PRs
The text was updated successfully, but these errors were encountered: