Author ncoghlan
Recipients Arfrever, ncoghlan, pitrou, serhiy.storchaka
Date 2012-06-30.12:56:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1341061000.59.0.584814332043.issue15216@psf.upfronthosting.co.za>
In-reply-to
Content
Indeed. However, the current alternatives (based on detach() and fileNo()) are also problematic - using detach() breaks the corresponding sys.__std*__ entry, while using fileNo() means you now have two independent IO stacks using the same underlying descriptor.

My own preference is to have a set_encoding() method that *can* be used even if IO has already occurred. Yes, there's the chance of mixing encodings if data is processed before the encoding is changed, but that's also true for both of the alternatives.

Pipeline applications written in Python should have an easy way to implement "--encoding" parameters for the standard IO streams, and a method to update the settings is the obvious choice.
History
Date User Action Args
2012-06-30 12:56:40ncoghlansetrecipients: + ncoghlan, pitrou, Arfrever, serhiy.storchaka
2012-06-30 12:56:40ncoghlansetmessageid: <1341061000.59.0.584814332043.issue15216@psf.upfronthosting.co.za>
2012-06-30 12:56:40ncoghlanlinkissue15216 messages
2012-06-30 12:56:39ncoghlancreate