Commit c6ea4869 authored by R David Murray's avatar R David Murray

Merge: #19063: the unicode-in-set_payload problem isn't getting fixed in 3.4.

parents e5197be1 c4acc92f
...@@ -303,8 +303,6 @@ class Message: ...@@ -303,8 +303,6 @@ class Message:
""" """
if hasattr(payload, 'encode'): if hasattr(payload, 'encode'):
if charset is None: if charset is None:
# We should check for ASCII-only here, but we can't do that
# for backward compatibility reasons. Fixed in 3.4.
self._payload = payload self._payload = payload
return return
if not isinstance(charset, Charset): if not isinstance(charset, Charset):
...@@ -352,8 +350,9 @@ class Message: ...@@ -352,8 +350,9 @@ class Message:
try: try:
cte(self) cte(self)
except TypeError: except TypeError:
# This if is for backward compatibility and will be removed # This 'if' is for backward compatibility, it allows unicode
# in 3.4 when the ascii check is added to set_payload. # through even though that won't work correctly if the
# message is serialized.
payload = self._payload payload = self._payload
if payload: if payload:
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment