[issue1096310] sys.__stdout__ doco isn't discouraging enough

Daniel Diniz report at bugs.python.org
Mon Feb 9 23:49:51 CET 2009


Daniel Diniz <ajaksu at gmail.com> added the comment:

Current docs seem to explain what __stdout__ is for:
"""
__stdin__ / __stdout__ / __stderr__

These objects contain the original values of stdin, stderr and stdout at
the start of the program. They are used during finalization, and could
be useful to restore the actual files to known working file objects in
case they have been overwritten with a broken object.
"""

Should a note of warning be added? Something like:

Explicitly saving the original IO streams and restoring them after
redirection is safer and the recommended idiom.

----------
nosy: +ajaksu2
versions: +Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1096310>
_______________________________________


More information about the Python-bugs-list mailing list