Show HN: Debugging-Friendly Tracebacks for Python
1–10 of 13 posts
Re: Show HN: Debugging-Friendly Tracebacks for Python
#2With nose-progressive, you can specify --progressive-editor or update the .noserc so that traceback filepaths are prefixed with your preferred editor command.
vim-unstack parses paths from stack traces / tracebacks (for a number of languages including Python) and opens each in a split at that line number. https://github.com/mattboehm/vim-unstack
Here's the Python regex from my hackish pytb2paths.sh script:
'\s+File "(?P.*)", line (?P\d+), in (?P.*)$'
https://github.com/westurner/dotfiles/blob/develop/scripts/p...Re: Show HN: Debugging-Friendly Tracebacks for Python
#3Re: Show HN: Debugging-Friendly Tracebacks for Python
#4Re: Show HN: Debugging-Friendly Tracebacks for Python
#5It would be nice to integrate the context functionality into https://github.com/Qix-/better-exceptions
# in site-packages/sitecustomize.py:
print('hello!')
import sys; sys.excepthook = lambda a,b,c: print('')
# or also:
import stackprinter
stackprinter.set_excepthook(style='darkbg')
(you can find the path by `python -c "import site; print(site.PREFIXES)" `)It felt bit much to do that automatically on installation, but maybe it would be a good option to have
Re: Show HN: Debugging-Friendly Tracebacks for Python
#6Re: Show HN: Debugging-Friendly Tracebacks for Python
#7It would be nice to integrate the context functionality into https://github.com/Qix-/better-exceptions
I always liked how this automatically hooks into the python installation via pip, but preferred another text format. Hm. So if you want to permanently replace python's crash message, you could put a file `sitecustomize.py` into your python path, with these contents for example: # in site-packages/sitecustomize.py: print('hello!') import sys; sys.excepthook = lambda a,b,c: print(' ') # or also: import stackprinter sta…
Thanks for making it available, the output looks neat, looking forward to try it out.
Re: Show HN: Debugging-Friendly Tracebacks for Python
#8I bring this up because this looks like it discloses variable values into the log that would not be printed in a standard traceback under most normal circumstances.
Re: Show HN: Debugging-Friendly Tracebacks for Python
#9If you're building a server application, you should be aware of the kinds of information you're writing to your application log. The first obvious issue is that of possibly disclosing information if the traceback is returned to the client instead of saved in the server log. The second, less obvious question is what kinds of statutory requirements you are under regarding retention of PII in your logs. And in the worst…