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 barry, beazley, brotchie, vstinner
Date 2009-01-02.01:21:57
SpamBayes Score 2.12385e-06
Marked as misclassified No
Message-id <>
> I think the library function base64.b64encode() should return 
> a string, not bytes.

Yes, in the email module, the payload is an unicode string, not a 
bytes string. We have to be able to concatenate headers 
(eg. "Content-Type: image/fish\nMIME-Version: 
1.0\nContent-Transfer-Encoding: base64\n") and encoded data 
(eg. "R0lGO").

Attached patch implements this fix: encode_base64() returns str (and 
not bytes). The patchs fixes the unit tests and adds a new regression 
test for MIMEImage.as_string().
Date User Action Args
2009-01-02 01:22:00vstinnersetrecipients: + vstinner, barry, beazley, brotchie
2009-01-02 01:22:00vstinnersetmessageid: <>
2009-01-02 01:21:59vstinnerlinkissue4768 messages
2009-01-02 01:21:57vstinnercreate