I am looking for a way to debug a python exception "retrospectively." Essentially, if my program raises an exception that is not being processed, I want it to save the state of the program so that I can return later and debug the problem.
I looked through the pdb docs and it seems that you can do this, but only if you can interact with the program at the exception point. This will not work for me, as the program will work in the background (without a control terminal).
My first (doomed!) Approach was to put the try / except block at the highest level of my program, and in the exception block, extract the trace object from the current exception and write it to disk using pickle. I then planned to write a separate program that would scatter the object and use pdb.post_mortem to debug the broken program. But trace objects are not legible, but I would not expect this to work, as this will not save the entire state of the program.
python debugging
yoda_alex
source share