Re: [Python-ideas] Replacing the standard IO streams (was Re: changing sys.stdout encoding)
10 Jun
2012
10 Jun
'12
12:22 p.m.
On 06/09/2012 08:26 PM, Nick Coghlan wrote:
Calling detach() on the standard streams is a bad idea - the interpreter uses the originals internally, and calling detach() breaks them.
The documentation for sys.std* specifically describes using detach() on the standard streams: | To write or read binary data from/to the standard | streams, use the underlying binary buffer. and gives example code. The only caveat mentioned is that detach() "can raise AttributeError or io.UnsupportedOperation" if the stream has benn replaced with something that does not support detach().
4346
Age (days ago)
4346
Last active (days ago)
0 comments
1 participants
participants (1)
-
Rurpy