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 pitrou
Recipients georg.brandl, pitrou, terry.reedy
Date 2008-11-29.22:48:03
SpamBayes Score 2.342113e-07
Marked as misclassified No
Message-id <1227998884.38.0.532377607433.issue4387@psf.upfronthosting.co.za>
In-reply-to
Content
It's not /exactly/ nonsense, it seems to assume an utf8 encoding pass is
necessary:

>>> b'\xe1\x80\x80'.decode('utf8') == '\u1000'
True

IMO, while accepting unicode strings instead of bytes for the a2b_xx
functions is understandable (because in practice only ASCII characters
are allowed), it is not acceptable for b2a_xx functions to accept
unicode strings instead of bytes.

In other words, it might/should be ok for
`binascii.a2b_base64('YWFh\n')` to return the same as
`binascii.a2b_base64('YWFh\n')` (that is, b'aaa'), but
`binascii.b2a_base64('aaa')` should raise a TypeError rather than
applying an utf8 encoding pass before doing the actual b2a encoding.

I think this must be fixed before 3.0 final, and is therefore a release
blocker.
History
Date User Action Args
2008-11-29 22:48:04pitrousetrecipients: + pitrou, georg.brandl, terry.reedy
2008-11-29 22:48:04pitrousetmessageid: <1227998884.38.0.532377607433.issue4387@psf.upfronthosting.co.za>
2008-11-29 22:48:03pitroulinkissue4387 messages
2008-11-29 22:48:03pitroucreate