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.

作者 vstinner
收信人 doerwalter, eric.araujo, lemburg, loewis, pitrou, vstinner
日期 2010-06-08.23:13:32
SpamBayes Score 0.00082432927
Marked as misclassified
Message-id <1276038814.42.0.999450131558.issue8838@psf.upfronthosting.co.za>
In-reply-to
内容
r81854 removes codecs.charbuffer_encode() (and t# parsing format) from Python 3.2 (blocked in 3.1: r81855).

--

My problem with codecs.readbuffer_encode() is that it does accept byte *and* character strings. If you want to get a byte string, just use bytes(input). If you want to convert a character string to a byte string, use input.encode("utf-8"). But accepting both types may lead to mojibake as we had in Python2.

MAL> That's a common misunderstanding. The codec system does not
MAL> mandate a specific type combination. Only the helper methods
MAL> .encode() and .decode() on bytes and str objects in Python3 do.

This is related to #7475: we have to decide if we drop completly this  (currently unused) feature (eg. remove codecs.readbuffer_encode()), or if we "reenable" this feature again (reintroduce hex, bz2, rot13, ... codecs). This discussion should occur on the mailing list.
历史
日期 用户 动作 参数
2010-06-08 23:13:34vstinner修改recipients: + vstinner, lemburg, loewis, doerwalter, pitrou, eric.araujo
2010-06-08 23:13:34vstinner修改messageid: <1276038814.42.0.999450131558.issue8838@psf.upfronthosting.co.za>
2010-06-08 23:13:33vstinner链接issue8838 messages
2010-06-08 23:13:32vstinner创建