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 vstinner
Recipients vstinner, yi.codeplayer
Date 2011-01-02.18:59:59
SpamBayes Score 1.7556695e-05
Marked as misclassified No
Message-id <1293994801.35.0.630709393661.issue10807@psf.upfronthosting.co.za>
In-reply-to
Content
base64, bz2, hex, quopri, rot13, uu and zlib codecs (reintroduced recently by r86934, issue #7475) cannot be used by str.encode/bytes.decode, but with .transform() and .untransform() methods of bytes and str objects. But these methods were removed by r87176.

The last solution to use base64 codec is:

>>> import codecs
>>> codecs.lookup('base64').decode(b'YWJj\n')[0]
b'abc'
>>> codecs.lookup('base64').encode(b'YWJj\n')[0]
b'abc'

Or simply use directly the base64 module:

>>> import base64
>>> base64.decodebytes(b'YWJj\n')
b'abc'
>>> base64.encodebytes(b'abc')
b'YWJj\n'

base64, bz2, hex, quopri, rot13, uu and zlib codecs should be removed from encodings.aliases (because they introduced a confusion for Python 2 users), or removed completly (because it's easier to use directly the related module, eg. base64 or zlib).
History
Date User Action Args
2011-01-02 19:00:01vstinnersetrecipients: + vstinner, yi.codeplayer
2011-01-02 19:00:01vstinnersetmessageid: <1293994801.35.0.630709393661.issue10807@psf.upfronthosting.co.za>
2011-01-02 18:59:59vstinnerlinkissue10807 messages
2011-01-02 18:59:59vstinnercreate