mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
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:
parent
4bf70686fa
commit
f1046ca817
7 changed files with 42 additions and 22 deletions
|
|
@ -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.
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue