mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
More email package related repairs. This fixes smtplib's import and use of
email.base64mime, but test_smtplib still has failures for me. They are timeout errors so think they're more related to my current wacky network setup than bugs remaining in the code related to the email package. This also r57693 that got clobbered with the sandbox sync, and fixes a couple of other minor problems that cropped up. I will kill the sandbox branch next. The email package now has 11F/11E.
This commit is contained in:
parent
5a23cc5a01
commit
2cc1f6d95b
6 changed files with 23 additions and 28 deletions
|
@ -201,7 +201,8 @@ class Message:
|
|||
# Incorrect padding
|
||||
pass
|
||||
elif cte in ('x-uuencode', 'uuencode', 'uue', 'x-uue'):
|
||||
in_file = BytesIO(bytes(payload + '\n'))
|
||||
payload += '\n'
|
||||
in_file = BytesIO(payload.encode('raw-unicode-escape'))
|
||||
out_file = BytesIO()
|
||||
try:
|
||||
uu.decode(in_file, out_file, quiet=True)
|
||||
|
@ -752,7 +753,8 @@ class Message:
|
|||
# LookupError will be raised if the charset isn't known to
|
||||
# Python. UnicodeError will be raised if the encoded text
|
||||
# contains a character not in the charset.
|
||||
charset = str(bytes(charset[2]), pcharset)
|
||||
as_bytes = charset[2].encode('raw-unicode-escape')
|
||||
charset = str(as_bytes, pcharset)
|
||||
except (LookupError, UnicodeError):
|
||||
charset = charset[2]
|
||||
# charset characters must be in us-ascii range
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue