From: Serhiy Storchaka Date: Fri, 25 Jan 2013 13:34:21 +0000 (+0200) Subject: Issue #9290: In IDLE the sys.std* streams now implement io.TextIOBase X-Git-Tag: v3.3.1rc1~295^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b1b3c0dfef5fbbd6fb2247758216bb1cbc157dc5;p=python Issue #9290: In IDLE the sys.std* streams now implement io.TextIOBase interface and support all mandatory methods and properties. --- b1b3c0dfef5fbbd6fb2247758216bb1cbc157dc5 diff --cc Lib/idlelib/run.py index dbf046bc5d,7d0941e80b..d10591246f --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@@ -323,11 -270,14 +285,15 @@@ class MyHandler(rpc.RPCHandler) """Override base method""" executive = Executive(self) self.register("exec", executive) - self.console = self.get_remote_proxy("stdin") - sys.stdin = _RPCInputFile(self.console) - sys.stdout = _RPCOutputFile(self.get_remote_proxy("stdout")) - sys.stderr = _RPCOutputFile(self.get_remote_proxy("stderr")) + self.console = self.get_remote_proxy("console") + sys.stdin = PyShell.PseudoInputFile(self.console, "stdin", + IOBinding.encoding) + sys.stdout = PyShell.PseudoOutputFile(self.console, "stdout", + IOBinding.encoding) + sys.stderr = PyShell.PseudoOutputFile(self.console, "stderr", + IOBinding.encoding) + + sys.displayhook = rpc.displayhook # page help() text to shell. import pydoc # import must be done here to capture i/o binding pydoc.pager = pydoc.plainpager