[IPython-user] traceback display error in WinXP / Emacs / IPython / ipython.el

Jie Tang jietang86@gmail....
Wed May 28 21:40:37 CDT 2008


Hi,

I'm using IPython under WinXP / Emacs / ipython.el for some time now.
I've been getting a delayed traceback display error where if I type the
following:

In [1]: asdf      # garbage, should throw NameError


In [2]: 1/0       # Should throw ZeroDivisionError
---------------------------------------------------------------------------
NameError                               Traceback (most recent call last)

c:\Python25\Lib\site-packages\IPython\<ipython console> in <module>()

NameError: name 'a' is not defined



In [3]: in         # should be syntax error
---------------------------------------------------------------------------
ZeroDivisionError                         Traceback (most recent call last)

c:\Python25\Lib\site-packages\IPython\<ipython console> in <module>()

ZeroDivisionError: integer division or modulo by zero

i.e., error output is delayed by one.


The most obvious explanation was that some pipe was not getting flushed,
and the traceback output was getting stuck.


I fixed this by going into ultraTB.py, which contains the traceback error
handling code. There are four "print >>" statements which are preceded
by "flush()" statements; putting the flush() statements after the prints
fixed
this problem. As far as I can tell there is no reason to have the flush
statements
before the prints.

The print statements are around lines 352, 831, 954


Jie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ipython.scipy.org/pipermail/ipython-user/attachments/20080528/61149a74/attachment.html 


More information about the IPython-user mailing list