[issue17838] Can't assign a different value for sys.stdin in IDLE
Terry J. Reedy
report at bugs.python.org
Sun Apr 28 19:47:32 CEST 2013
Terry J. Reedy added the comment:
Roger: yes. This solves immediate problem and makes Idle more like console interpreter. Same should be done for all three.
Serhiy: the sole and documented purpose of sys.__stdxyz__ is to serve as backup bindings for the three i/o streams, so rebinding them is senseless. I would be willing to say 'you get what you deserve if you do that'. But since console tolerates double rebinding, we can make Idle do so too. Again, same should be done for all three streams.
See attached patch. It seems to work, but someone please recheck for typos. Are we sure that binding streams to handler object cannot cause problems, such as during shutdown with atexit handlers?
----------
Added file: http://bugs.python.org/file30050/Terry17838.diff
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17838>
_______________________________________
More information about the Python-bugs-list
mailing list