[Python-checkins] cpython (merge 3.3 -> default): Merge: #19063: the unicode-in-set_payload problem isn't getting fixed in 3.4.

r.david.murray python-checkins at python.org
Fri Feb 7 19:06:40 CET 2014


http://hg.python.org/cpython/rev/aab7258a31d3
changeset:   89020:aab7258a31d3
parent:      89019:ef8aaace85ca
parent:      89017:4daf3cec9419
user:        R David Murray <rdmurray at bitdance.com>
date:        Fri Feb 07 13:04:18 2014 -0500
summary:
  Merge: #19063: the unicode-in-set_payload problem isn't getting fixed in 3.4.

files:
  Lib/email/message.py |  7 +++----
  1 files changed, 3 insertions(+), 4 deletions(-)


diff --git a/Lib/email/message.py b/Lib/email/message.py
--- a/Lib/email/message.py
+++ b/Lib/email/message.py
@@ -303,8 +303,6 @@
         """
         if hasattr(payload, 'encode'):
             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
                 return
             if not isinstance(charset, Charset):
@@ -352,8 +350,9 @@
             try:
                 cte(self)
             except TypeError:
-                # This if is for backward compatibility and will be removed
-                # in 3.4 when the ascii check is added to set_payload.
+                # This 'if' is for backward compatibility, it allows unicode
+                # through even though that won't work correctly if the
+                # message is serialized.
                 payload = self._payload
                 if payload:
                     try:

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list