config option to truncate traceback
See original GitHub issueIt would be useful to be able to be able to have the option to truncate the display of error traceback. When writing documentation, it is useful just to show that an error occurred without showing the full traceback. This practice is commonly done in terminal view.
There is sys.tracebacklimit
setting. However, it does not work in Jupyter and needs a rather complex override: https://stackoverflow.com/questions/46222753/how-do-i-suppress-tracebacks-in-jupyter
I would propose adding a jupyter_sphinx_truncate_traceback
option that would just show the first two lines of the normal traceback message followed by an ellipsis, e.g.
---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
...
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
python - Hide traceback unless a debug flag is set
The short way is using the sys module and use this command: sys.tracebacklimit = 0. Use your flag to determine the behaviour. Example:...
Read more >Understanding the Python Traceback
In this step-by-step tutorial, you'll learn how to read and understand the information you can get from a Python traceback. You'll walk through...
Read more >traceback — Print or retrieve a stack traceback — Python 3.11 ...
Return a StackSummary object representing a list of “pre-processed” stack trace entries extracted from the traceback object tb. It is useful for alternate ......
Read more >traceback: Get and Print Call Stacks - Rdrr.io
traceback () returns the deparsed call stack deepest call first as a list or pairlist. The number of lines deparsed from the call...
Read more >Creating Beautiful Tracebacks with Python's Exception Hooks
traceback . Another popular option is better_exceptions . It also produces nice output, but requires a little more setup: # https://github.
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 FreeTop 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
Top GitHub Comments
Would running
%xmode Minimal
, perhaps in a hidden cell, address this use case for Python-based kernels?Thanks @danielballan! That’s a great solution, and it works in this use case.