[issue11156] email.encoders.encode_base64 create a single long line

Yves Dorfsman report at bugs.python.org
Wed Feb 9 03:10:00 CET 2011


New submission from Yves Dorfsman <yves at zioup.com>:

email.encoders.encode_base64 returns a str of a single long line instead of breaking it up into 76 chars line as per RFC 2045, and as implemented by email.base64mime.

Solution:
In /usr/lib/python3.1/email/encoders.py, use encodebytes instead of b64encode:

--- encoders.py 2011-02-08 09:37:21.025030051 -0700
+++ encoders.py.yves    2011-02-08 09:38:04.945608365 -0700
@@ -12,7 +12,7 @@
     ]
 
 
-from base64 import b64encode as _bencode
+from base64 import encodebytes as _bencode
 from quopri import encodestring as _encode

----------
components: Library (Lib)
messages: 128202
nosy: yves at zioup.com
priority: normal
severity: normal
status: open
title: email.encoders.encode_base64 create a single long line
versions: Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11156>
_______________________________________


More information about the Python-bugs-list mailing list