Automatic bug reporting?
Fernando Perez
fperez528 at yahoo.com
Mon Aug 5 18:28:20 EDT 2002
Jeremy Fincher wrote:
> Is there any module already available that can be used, for example,
> in a "catch all" exception handler to email the developer the
> almost-uncaught exception and its traceback?
>
> For robustness' sake, my program needs to catch all exceptions and
> keep them from crashing the program, but those exceptions are bugs
> nonetheless and I'd like to get reports of their existence so I can
> fix them. Of course, any module would be by default disabled and
> would only be enabled at the user's specific request.
You can look at ipython's CrashHandler module at
http://www-hep.colorado.edu/~fperez/ipython/
When ipython crashes (rare, fortunately :) it generates a detailed log with a
full traceback (with lots more detail than the regular ones, it's basically a
text port of cgitb done by Nathan Gray and modified by me). Then it tells the
user about it and prints the command line necessary for emailing. I don't
email it automatically, but doing it would be a trivial change.
You want a traceback with a lot more detail than a normal one if this idea is
going to work. Remember that you are debugging post-mortem something that
happened on someone else's computer. But with these over-detailed tracebacks
that Nathan put together it works like a charm. I recently was able to file a
bug report (with fix) against pdb in the standard distro simply from reading
an ipython crash report mailed by a user. The key was all the context
information pointing me exactly to where the problem had occurred, which is
not present in a normal traceback.
Cheers,
f.
More information about the Python-list
mailing list