[issue24595] InteractiveInterpreter always prints to stdout

2015-12-10 Thread Terry J. Reedy
Terry J. Reedy added the comment: I strongly prefer attribute, as in the patch. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue24595] InteractiveInterpreter always prints to stdout

2015-12-10 Thread Berker Peksag
Berker Peksag added the comment: I agree with David. I've added a "stream" attribute to InteractiveInterpreter. I don't have a strong preference between a getstream method and a stream attribute(or something different) so I will add documentation changes and tests later. -- keywords:

[issue24595] InteractiveInterpreter always prints to stdout

2015-08-03 Thread Terry J. Reedy
Terry J. Reedy added the comment: There is also redirect_stderr, but not for stdin. I am not sure what specific issue is left here, of if this should be closed. -- ___ Python tracker _

[issue24595] InteractiveInterpreter always prints to stdout

2015-08-03 Thread Martin Panter
Martin Panter added the comment: Terry: perhaps you’re thinking of :) -- nosy: +vadmium ___ Python tracker

[issue24595] InteractiveInterpreter always prints to stdout

2015-07-11 Thread Terry J. Reedy
Terry J. Reedy added the comment: To me, this cries out for a public context manager ( believe there is a public one in test.support, or something), so one can write with stdout(ob): print(stuff) I am not sure, though, where the C.M.s should live. -- nosy: +terry.reedy

[issue24595] InteractiveInterpreter always prints to stdout

2015-07-09 Thread R. David Murray
R. David Murray added the comment: Does it not work to create an unbuffered makefile object from the socket and assign that to stdout? Regardless, if you need to set it and restore it around runcode you can use super() to call the base class method. I think providing an easier API to change s

[issue24595] InteractiveInterpreter always prints to stdout

2015-07-09 Thread Anton Astafiev
New submission from Anton Astafiev: I have a use-case when I need to forward InteractiveConsole through Unix/TCP socket. Expected implementation: class InteractiveSocket(InteractiveConsole): def __init__(self, socket): self._socket = socket ... def raw_input(...): # read from s