Author nikratio
Recipients Arfrever, elixir, ishimoto, jwilk, loewis, methane, mrabarnett, ncoghlan, nikratio, pitrou, rurpy2, serhiy.storchaka, vstinner
Date 2014-02-02.21:51:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The attached patch now passes all testcases. 

However, every invocation of set_encoding() when there is buffered data leaks one reference. I haven't been able to find the error yet.

As for adding a reopen() or configure() method: I don't like it very much, but for the same reasons that I still don't like set_encoding() itself: it makes a rather fragile operation appear well-supported. set_encoding already inserts BOM in the middle of non-seekable streams, and invalidates tell cookies for seekable streams. Changing the buffering would probably face similar problems if there is buffered data but buffering is supposed to be turned off.

I think it would be better to restrict this functionality strictly to sys.stdin/out/err and in all other situations fix the API that results in the TextIO object with undesired parameters. For example, in the case of the subprocess module, wouldn't it be better to return pipes as byte streams and have the caller wrap them into text streams?
Date User Action Args
2014-02-02 21:51:28nikratiosetrecipients: + nikratio, loewis, ishimoto, ncoghlan, pitrou, vstinner, jwilk, mrabarnett, Arfrever, methane, rurpy2, serhiy.storchaka, elixir
2014-02-02 21:51:28nikratiosetmessageid: <>
2014-02-02 21:51:28nikratiolinkissue15216 messages
2014-02-02 21:51:28nikratiocreate