diff -r 6297fcddf912 Lib/idlelib/run.py --- a/Lib/idlelib/run.py Fri Apr 19 12:57:54 2013 -0400 +++ b/Lib/idlelib/run.py Sat Apr 27 20:45:34 2013 -0500 @@ -293,6 +293,10 @@ sys.stderr = PyShell.PseudoOutputFile(self.console, "stderr", IOBinding.encoding) + # Keep a reference to stdin so that it won't try to exit IDLE + # if sys.stdin gets changed from within IDLE's shell. See issue17838. + self._keep_stdin = sys.stdin + sys.displayhook = rpc.displayhook # page help() text to shell. import pydoc # import must be done here to capture i/o binding