Skip to content

Commit fcc0072

Browse files
committed
#19063: the unicode-in-set_payload problem isn't getting fixed in 3.4.
1 parent 5cfc79d commit fcc0072

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

Lib/email/message.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,6 @@ def set_payload(self, payload, charset=None):
277277
"""
278278
if hasattr(payload, 'encode'):
279279
if charset is None:
280-
# We should check for ASCII-only here, but we can't do that
281-
# for backward compatibility reasons. Fixed in 3.4.
282280
self._payload = payload
283281
return
284282
if not isinstance(charset, Charset):
@@ -326,8 +324,9 @@ def set_charset(self, charset):
326324
try:
327325
cte(self)
328326
except TypeError:
329-
# This if is for backward compatibility and will be removed
330-
# in 3.4 when the ascii check is added to set_payload.
327+
# This 'if' is for backward compatibility, it allows unicode
328+
# through even though that won't work correctly if the
329+
# message is serialized.
331330
payload = self._payload
332331
if payload:
333332
try:

0 commit comments

Comments
 (0)