[IPython-dev] [Matplotlib-users] Bug in mathtext

Jörgen Stenarson jorgen.stenarson at bostream.nu
Wed Dec 5 15:00:23 EST 2007


Fernando Perez skrev:
> On Dec 5, 2007 12:19 PM, Jörgen Stenarson <jorgen.stenarson at bostream.nu> wrote:
>> Jörgen Stenarson skrev:
>>> Thanks Mike. I hope we can figure out what is causing the crashes but I
>>> guess we can take this over on the ipython-list. Fernando have you tried
>>> it on a windows machine? I'm using tkagg. Do you have any ideas on what
>>> I could start testing to isolate the problem?
>>>
>>> /Jörgen
>>
>> Fernando, I found the problem. I have a pylab.show() in my
>> generate_prompt hook to get automatic refresh after calling scripts.
>> Anyway it seems exceptions raised here crash ipython. I don't know if
>> this is intentional or not. I just put a try block around it as a
>> workaround.
> 
> OK, that makes sense now.  I think it qualifies as a bug in our part,
> since hooks should always  be protected.  They should generate the
> traceback, but not crash out.
> 
> Trac-ticket it, baby :)
>
Done #202
> [ aside]  BTW, when I first wrote the pylab support, I added an
> automatic show() at the end.  I later removed it to force users
> (including myself, since I use this all day long) to put a
> 
> pylab.show()
> 
> as the last line of my scripts.  Doing this ensures that the script
> actually runs inside or outside of ipython equally well, without funny
> surprises when you send it to a colleague (who doesn't use ipython)
> and they see no plots :)  So now I've just become used to always
> finishing all my scripts with the show() call.  That way, if there's
> an exception in there, it still gets handled just like any other
> exception.
> [/aside]
> 

That is certainly a good point. But I usually have a script that saves 
my figure to a file as well as showing it. And I don't want it to block 
when running as a standalone script but I want to see them when running 
from ipython.
/Jörgen






More information about the IPython-dev mailing list