`--pdb` support to debug error on task execution
See original GitHub issueSupport post-mortem debugger for unhadled task execution exceptions.
This must handled separately from exceptions on load time. Because doit catches tasks errors and keep running…
(original report)
I’m trying to debug a doit pipeline and need to break into pdb in a library I’m using from doit. Unfortunately, doit captures all in- and output, which I have to undo everywhere I’m trying to debug. Would be nice to have the above mentioned parameter that lets me just do import pdb; pdb.set_trace()
(or breakpoint()
in the upcoming Python 3.7).
For reference, this is the code I currently use to break into pdb:
try:
code_that_crashes_somewhere_in_your_pipeline
except KeyError:
import pdb, sys;
d = pdb.Pdb(stdin=sys.__stdin__, stdout=sys.__stdout__)
d.reset(); t = sys.exc_info()[2]; d.interaction(None, t)
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Advanced Python Debugging with pdb | Codementor
The pdb module can take multiple -c arguments on the command line to execute commands as soon as the debugger starts.
Read more >Python Debugging With Pdb
In this hands-on tutorial, you'll learn the basics of using pdb, Python's interactive source code debugger. Pdb is a great tool for tracking...
Read more >How to use the Python debugger (pdb) - Red Hat
Pdb is a powerful tool for finding syntax errors, spelling mistakes, missing code, and other issues in your Python code.
Read more >Symbol / PDB files in the Visual Studio debugger
The .pdb file holds debugging and project state information that allows incremental linking of a Debug configuration of your app. The Visual ...
Read more >How to handle script errors that call pdb? - Stack Overflow
I have to include in my overall test flow a script that I have no control over, which initiates python debugger when it...
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
Like this: http://pydoit.org/cmd_run.html#pdb 😁
But this only works to debug issues that happen when loading tasks. Not on task execution… actually I too wished sometimes it would work to debug actual task execution.
I googled “python doit debug” but must embarrassingly admit that I scrolled over your link. Oops.
The snippet I use above has the nice property to break into pdb where the exception occurs without me having to know in advance where exactly it occurs. pytest has the
--pdb
switch which will launch a pdb shell at the point of the exception (https://docs.pytest.org/en/latest/usage.html#dropping-to-pdb-python-debugger-on-failures). I think that would be useful to have in doit, too.