Actually, it would be fine if matplotlib overrode
>> sys.except_hook and ipython later came along and overrode that.
>> Basically, ipython would be saying, "I know I've got a shell to
>> display errors in, so we don't need to GUI method". I don't
>> think matplotlib would have a problem with that. Ditto for
>> envisage. Basically, we would be providing a default method to
>> get the message to the GUI which could be overriden by other
>> applications that want to (ipython, envisage, what-have-you).
> I guess this is a good heads-up for me. I know ipython
> does some of this, I'll just add a bit more such
> control. That way, if during the running of user code
> they need sys.ehook for something, they'll get it. But
> ipython will keep it for when it needs it. I'm pretty
> sure the embeddable ipython has such control in it, I
> may just need to put it in the general case as well.
> Ultimately I'm not 100% sure what a good solution for
> matplotlib is, I just wanted to make you aware of these
> issues, so that at least they are on your radar.
We do have some more options. For one, we could use the excepthook
only in the matlab interface -- in this case matlab is being used more
as an application rather than a library. Folks using matplotlib as a
library, eg embedding in a GUI, would be advised to do their own
The only exceptional case I see is basically the ipython (and friends)
case. Ie, someone wants to write a shell or otherwise that embeds
matplotlib.matlab. In this case it would be fine to override
matplotlib.matlab's excepthook, as discussed.
To play really nicely, matplotlib.matlab would like to be able to
override excepthook only if it hadn't been otherwise overridden. I
don't see any elegant way to do this. Any ideas?