This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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 <CADiSq7dLZbOX+PKe5W8qh8TCUyYimphTEz-Nxm-bybFRDuqqgA@mail.gmail.com>
In-reply-to <1390967214.06.0.469364259306.issue15216@psf.upfronthosting.co.za>
Content
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.
History
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