Ticket #248 (assigned defect)

Opened 5 months ago

Last modified 4 months ago

magic commands inhibit autoflush of output to console

Reported by: LevGivon Assigned to: vivainio (accepted)
Priority: normal Milestone:
Component: ipython Version:
Severity: normal Keywords: magic, autoflush, console
Cc:

Description

It seems that the invocation of magic commands (e.g., ?, %pcat, etc.) causes ipython to delay writing output generated by any subsequently executed code to the console until the entire block of code in question is run. For instance, if one runs the following code

import time                                                                     
for i in xrange(3):                                                             
    print i                                                                     
    time.sleep(2)                                                               

from within ipython, accesses the help system with the ? command, and then attempts to run the above a second time, one will notice that no output is written to the console until the script finishes running.

I have observed this behavior using both ipython 0.8.2 and the latest development revision (104) on Linux with Python 2.5.2 (in both cases, I removed ~/.ipython prior to testing the behavior).

Change History

05/29/08 10:35:25 changed by LevGivon

The problem also exists in 0.8.3.

05/30/08 14:28:42 changed by vivainio

  • status changed from new to assigned.
  • owner changed from fperez to vivainio.

06/03/08 13:15:55 changed by vivainio

Perhaps this is because the terminal color sequences output by e.g. pycat screw up readline output buffering on linux. pyreadline + windows work ok.

06/03/08 13:37:15 changed by LevGivon

The problem only manifests itself with certain terminal types. Running ipython with TERM=xterm does cause the problem to occur, for instance; the types vt100, rxvt, and xterm-color do not. I'm using termcap 11.0.1.