Limit traceback to one entry by default
See original GitHub issueWhat’s the problem this feature will solve?
Large and unnecessary tracebacks in user bug-reports
Describe the solution you’d like
Set the trace-back limit sys.tracebacklimit
to 1 by default. Don’t set when verbose-logging (ie -vv
passed at command-line). This includes build-backend subprocesses (in the vendored pep517 subprocess), but not when using an in-tree build-backend.
Alternative Solutions
None
Additional context
None
Code of Conduct
- I agree to follow the PSF Code of Conduct.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
How to limit python traceback to specific files - Stack Overflow
It will SHOW traceback entries for files from these directories. ''' show = tuple(join(abspath(p), '') for p in show) def _check_file(name): return name...
Read more >traceback — Print or retrieve a stack traceback — Python 3.11 ...
Print up to limit stack trace entries from traceback object tb (starting from the caller's frame) if limit is positive. Otherwise, print the...
Read more >Understanding the Python Traceback
Python prints a traceback when an exception is raised in your code. The traceback output ... These calls are represented by two-line entries...
Read more >traceback – Extract, format, and print exceptions and stack ...
A traceback is a stack trace from the point of an exception handler down the ... in traceback mimic the behavior of the...
Read more >Traceback in Python - GeeksforGeeks
traceback.print_tb(tb, limit = None, file = None) : If limit is positive it prints upto limit stack trace entries from traceback object tb....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I don’t think they are unnecessary by any means. And, making the build-backend process fail gracefully is the responsibility of the build backend – pip shouldn’t be trying to cooerce their output to be shorter and potentially make it more difficult for the authors to diagnose issues.
FWIW, I do agree that we should be presenting our internal errors differently though. Something like rich’s tracebacks could make sense for that. I have a draft patch somewhere, adding rich tracebacks and a
PIP_RICH_TRACEBACKS=0
,pip --no-rich-tracebacks
.