[Python-3000-checkins] r58859 - python/branches/py3k-pep3137/Lib/email/base64mime.py

christian.heimes python-3000-checkins at python.org
Mon Nov 5 16:29:44 CET 2007


Author: christian.heimes
Date: Mon Nov  5 16:29:43 2007
New Revision: 58859

Modified:
   python/branches/py3k-pep3137/Lib/email/base64mime.py
Log:
The base64* methods are returning ascii data.

Modified: python/branches/py3k-pep3137/Lib/email/base64mime.py
==============================================================================
--- python/branches/py3k-pep3137/Lib/email/base64mime.py	(original)
+++ python/branches/py3k-pep3137/Lib/email/base64mime.py	Mon Nov  5 16:29:43 2007
@@ -70,7 +70,7 @@
     # Return empty headers unchanged
     if not header_bytes:
         return str(header_bytes)
-    encoded = b64encode(header_bytes).decode(charset)
+    encoded = b64encode(header_bytes).decode("ascii")
     return '=?%s?b?%s?=' % (charset, encoded)
 
 
@@ -93,7 +93,7 @@
     for i in range(0, len(s), max_unencoded):
         # BAW: should encode() inherit b2a_base64()'s dubious behavior in
         # adding a newline to the encoded string?
-        enc = b2a_base64(s[i:i + max_unencoded]).decode()
+        enc = b2a_base64(s[i:i + max_unencoded]).decode("ascii")
         if enc.endswith(NL) and eol != NL:
             enc = enc[:-1] + eol
         encvec.append(enc)


More information about the Python-3000-checkins mailing list