Skip to content

Commit feb6852

Browse files
committed
Merge: python#19063: the unicode-in-set_payload problem isn't getting fixed in 3.4.
2 parents 15a693a + fcc0072 commit feb6852

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Lib/email/message.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,6 @@ def set_payload(self, payload, charset=None):
303303
"""
304304
if hasattr(payload, 'encode'):
305305
if charset is None:
306-
# We should check for ASCII-only here, but we can't do that
307-
# for backward compatibility reasons. Fixed in 3.4.
308306
self._payload = payload
309307
return
310308
if not isinstance(charset, Charset):
@@ -352,8 +350,9 @@ def set_charset(self, charset):
352350
try:
353351
cte(self)
354352
except TypeError:
355-
# This if is for backward compatibility and will be removed
356-
# in 3.4 when the ascii check is added to set_payload.
353+
# This 'if' is for backward compatibility, it allows unicode
354+
# through even though that won't work correctly if the
355+
# message is serialized.
357356
payload = self._payload
358357
if payload:
359358
try:

0 commit comments

Comments
 (0)