Author ncoghlan
Recipients Arfrever, elixir, ishimoto, jwilk, loewis, methane, mrabarnett, ncoghlan, nikratio, pitrou, rurpy2, serhiy.storchaka, vstinner
Date 2014-01-29.07:46:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
The specific motivating use cases I'm aware of involve the standard
streams (for example, "How would you implement the equivalent of iconv
in Python 3?"). There's actually the workaround for the missing
feature right now: replace the standard streams with new streams,
either by detaching the old ones or using the file descriptor with
open(). It's also specifically the shadow references in __stdin__,
__stdout__ and __stderr__ that make that replacement approach
problematic (detaching breaks the shadow streams, using the file
descriptor means you now have two independent IO stacks sharing the
same descriptor).

However, the other case where I can see this being useful is in pipes
created by the subprocess module, and any other situation where an API
creates a stream on your behalf, and you can't readily ensure you have
replaced all the other references to that stream. In those cases, you
really want to change the settings on the existing stream, rather than
tracking down all the other references and rebinding them.

Another question is whether or not we want to implement this as a
no-op on StringIO.
Date User Action Args
2014-01-29 07:46:46ncoghlansetrecipients: + ncoghlan, loewis, ishimoto, pitrou, vstinner, jwilk, mrabarnett, Arfrever, methane, nikratio, rurpy2, serhiy.storchaka, elixir
2014-01-29 07:46:46ncoghlanlinkissue15216 messages
2014-01-29 07:46:46ncoghlancreate