➜

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.

作者 ncoghlan
收信人 Arfrever, ncoghlan, pitrou, serhiy.storchaka
日期 2012-06-30.12:56:39
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1341061000.59.0.584814332043.issue15216@psf.upfronthosting.co.za>
In-reply-to
内容
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.
历史
日期 用户 动作 参数
2012-06-30 12:56:40ncoghlan修改recipients: + ncoghlan, pitrou, Arfrever, serhiy.storchaka
2012-06-30 12:56:40ncoghlan修改messageid: <1341061000.59.0.584814332043.issue15216@psf.upfronthosting.co.za>
2012-06-30 12:56:40ncoghlan链接issue15216 messages
2012-06-30 12:56:39ncoghlan创建