[issue4329] base64 does not properly handle unicode strings

2008-11-26 Thread Michael Becker
Michael Becker <[EMAIL PROTECTED]> added the comment: Terry, I had a feeling Django had something to do with this. I'll have a closer look there. For reference, in my django code, I did not explicitly declare the string as a unicode string. Django must be importing unicode_literals from __future_

[issue4329] base64 does not properly handle unicode strings

2008-11-26 Thread Terry J. Reedy
Terry J. Reedy <[EMAIL PROTECTED]> added the comment: 2.6 is, as far as I know, intended to be backwards compatible except for where it fixes bugs. Upgrading to 2.6 does (should) not change strings (type str) to unicode. Only importing the appropriate __future__ or upgrading to 3.0 will do that

[issue4329] base64 does not properly handle unicode strings

2008-11-25 Thread Michael Becker
Michael Becker <[EMAIL PROTECTED]> added the comment: Terry, Thanks for your response. My main concern was that the behavior changed when updating from 2.5 to 2.6. The new behavior was not intuitive. Also 2.6, I thought, was supposed to be backward compatible. Based on this issue, I would assume

[issue4329] base64 does not properly handle unicode strings

2008-11-21 Thread Terry J. Reedy
Changes by Terry J. Reedy <[EMAIL PROTECTED]>: -- resolution: fixed -> invalid ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bug

[issue4329] base64 does not properly handle unicode strings

2008-11-21 Thread Terry J. Reedy
Terry J. Reedy <[EMAIL PROTECTED]> added the comment: "This module provides data encoding and decoding as specified in RFC 3548. This standard defines the Base16, Base32, and Base64 algorithms for encoding and decoding arbitrary binary strings into text strings that can be safely sent by email, u

[issue4329] base64 does not properly handle unicode strings

2008-11-21 Thread STINNER Victor
STINNER Victor <[EMAIL PROTECTED]> added the comment: It's not a bug. base64 is a codec to encode *bytes* and characters. You have to encode your unicode string to bytes using a charset Example (utf-8): >>> from base64 import b64encode, b64decode >>> b64encode(u'a\xe9'.encode("utf-8")) 'YcOp' >

[issue4329] base64 does not properly handle unicode strings

2008-11-15 Thread Michael Becker
New submission from Michael Becker <[EMAIL PROTECTED]>: See below. unicode string causes exception. Explicitly converting it to a regular string addresses the issue. I only noticed this because my input string changed to unicode after updating python to 2.6 and django to 1.0. >>> import base64 >