Hi,<br><br>I'm using IPython under WinXP / Emacs / ipython.el for some time now. <br>I've been getting a delayed traceback display error where if I type the following:<br><br>In [1]: asdf # garbage, should throw NameError<br>
<br><br>In [2]: 1/0 # Should throw ZeroDivisionError<br>---------------------------------------------------------------------------<br>NameError Traceback (most recent call last)<br><br>
c:\Python25\Lib\site-packages\IPython\<ipython console> in <module>()<br><br>NameError: name 'a' is not defined<br><br><br><br>In [3]: in # should be syntax error<br>---------------------------------------------------------------------------<br>
ZeroDivisionError Traceback (most recent call last)<br><br>c:\Python25\Lib\site-packages\IPython\<ipython console> in <module>()<br><br>ZeroDivisionError: integer division or modulo by zero<br>
<br>i.e., error output is delayed by one.<br><br><br>The most obvious explanation was that some pipe was not getting flushed,<br>and the traceback output was getting stuck.<br><br><br>I fixed this by going into ultraTB.py, which contains the traceback error <br>
handling code. There are four "print >>" statements which are preceded<br>by "flush()" statements; putting the flush() statements after the prints fixed <br>this problem. As far as I can tell there is no reason to have the flush statements<br>
before the prints.<br><br>The print statements are around lines 352, 831, 954<br><br><br>Jie<br>