[IPython-user] Re: IPython Crash Report

Fernando Perez fperez at colorado.edu
Tue May 13 13:59:12 CDT 2003


Gary Bishop wrote:
> I may look into this when I get a chance. If I discover anything I'll 
> be sure to let you know. I've been wanting to figure out what wxPython 
> does with exceptions anyway, this will be a good excuse.
> 
> As far as I can tell this is not an issue with threads. I can watch 
> with task manager and I see that my program has only 1 thread. That 
> says to me they are catching the exception in their mainloop (probably 
> noticing is a better word since they are in C), calling the python 
> exception handling, and then continuing. We *might* be able to modify 
> that process.

Ah, if there's only one thread, then you must be right.  Their mainloop must 
be rerouting exceptions directly to sys.excepthook, instead of letting them 
propagate through.  That's my guess from the behavior I observed.

> Where/how does IPython decide that it has crashed?

Well, I set sys.excepthook to an instance of IPythonCrashHandler, which is a 
callable exception handler.  Since I try very hard to trap _every_ other 
exception and handle it gracefully, anything that reaches sys.excepthook is 
considered to be a crash condition.  But if, under the hood, something catches 
an exception and directly jumps to sys.excepthook, I have no way of knowing that.

Please keep me (cc:list) posted if you make any progress on this one.  It may 
be possible to re-organize some things in ipython to handle this more 
gracefully, but at this moment I don't even see what the approach should be.

Cheers,

f.




More information about the IPython-user mailing list