Issue #4770: Restrict binascii module to accept only bytes (as specified).

And fix the email package to encode to ASCII instead of ``raw-unicode-escape`` before ASCII-to-binary decoding.
This commit is contained in:
Florent Xicluna 2010-07-27 21:20:15 +00:00
parent 4bf70686fa
commit f1046ca817
7 changed files with 42 additions and 22 deletions

View file

@ -74,12 +74,12 @@ def header_encode(header_bytes, charset='iso-8859-1'):
def body_encode(s, maxlinelen=76, eol=NL):
"""Encode a string with base64.
r"""Encode a string with base64.
Each line will be wrapped at, at most, maxlinelen characters (defaults to
76 characters).
Each line of encoded text will end with eol, which defaults to "\\n". Set
Each line of encoded text will end with eol, which defaults to "\n". Set
this to "\r\n" if you will be using the result of this function directly
in an email.
"""