[IPython-user] stderr missing in IPython + Emacs + WinXP

Joe Covalesky joe@nowsol....
Thu Jun 5 21:04:28 CDT 2008


I tried the trunk pyreadline.  While it fix the problem that originally 
made me revert to pyreadline 1.3 (none of
the output prompts/ stdout show up), it doesn't help with the problem 
where output to stderr is missing.

I tried Jie's suggestion, I modified iplib.InteractiveShell.interact's 
while loop to read as follows, but no dice:

 while not self.exit_now:
            if more:
                prompt = self.hooks.generate_prompt(True)
                if self.autoindent:
                    self.rl_do_indent = True
                   
            else:
                Term.cout.flush()
                Term.cerr.flush()
                prompt = self.hooks.generate_prompt(False)


As a reminder, here's the problematic scenario from an emac's user's 
point-of-view:

IPython 0.8.2 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object'. ?object also works, ?? prints more.

In [1]: done

In [2]: from sys import stdout, stderr

In [3]: stdout.write('foo')
foo
In [4]: stderr.write('bar')

In [5]:

In [6]:

Joe

Regarding Jorgen's
>
>
> ------------------------------
>
> Message: 2
> Date: Mon, 2 Jun 2008 15:45:14 -0400
> From: "Jie Tang" <jietang86@gmail.com>
> Subject: Re: [IPython-user] stderr missing in IPython + Emacs + WinXP
> To: ipython-user@scipy.org
> Message-ID:
> 	<b1f76a5b0806021245n417e2446mc277bd138d9eeea6@mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi Joe,
>
> I'm seeing the same sort of behavior you describe on IPython/Emacs/XP. It
> seems like sys.stderr has some buffering issues; if I flush the stream using
> stderr.flush() after writing to it the text displays.
>
> As a workaround I added calls to
>
> Term.cout.flush()
> Term.cerr.flush()
>
> right before IPython's "In[]" input prompt is displayed (around line 1675 in
> iplib.py)
>
> Jie
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://lists.ipython.scipy.org/pipermail/ipython-user/attachments/20080602/7f6b842f/attachment-0001.html 
>
> ------------------------------
>
>   
>   




More information about the IPython-user mailing list