[issue12402] Overriding code.InteractiveConsole.write does not work

2011-06-24 Thread R. David Murray
Changes by R. David Murray : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue12402] Overriding code.InteractiveConsole.write does not work

2011-06-24 Thread Miki Tebeka
Miki Tebeka added the comment: I'm trying to read/write data from a socket. Does this mean I need to roll up my own Interpreter? (e.g. no way to override writing to stdout?) Since this is the expected behaviour, will close this one. -- status: closed -> open _

[issue12402] Overriding code.InteractiveConsole.write does not work

2011-06-24 Thread R. David Murray
R. David Murray added the comment: That's correct. The write method is for writing to stderr, and by implication is called only for errors. Not, I think, the most obvious name that could have been chosen for the method, but it does seem to be doing what it is documented to do in your exampl

[issue12402] Overriding code.InteractiveConsole.write does not work

2011-06-24 Thread Miki Tebeka
New submission from Miki Tebeka : Consider the following code: import code class Console(code.InteractiveConsole): def write(self, data): print("DATA: {0}".format(data)) c = Console() c.interact() Then enter "1" at the prompt. The output will be 1 (and not D