flox <la...@yahoo.fr> added the comment: > Are you sure that this patch is correct (which RFC says > that quoted printable should use our raw-unicode-escape > codec ?):
I am not sure of anything. It is an "educated guess" at the most. Since 'base64' and 'x-uuencode' both use 'raw-unicode-escape'... See longer excerpt below. Index: Lib/email/message.py =================================================================== --- Lib/email/message.py (revision 76839) +++ Lib/email/message.py (working copy) @@ -189,24 +189,26 @@ elif not isinstance(self._payload, list): raise TypeError('Expected list, got %s' % type(self._payload)) else: payload = self._payload[i] if not decode: return payload # Decoded payloads always return bytes. XXX split this part out into # a new method called .get_decoded_payload(). if self.is_multipart(): return None cte = self.get('content-transfer-encoding', '').lower() if cte == 'quoted-printable': + if isinstance(payload, str): + payload = payload.encode('raw-unicode-escape') return utils._qdecode(payload) elif cte == 'base64': try: if isinstance(payload, str): payload = payload.encode('raw-unicode-escape') return base64.b64decode(payload) #return utils._bdecode(payload) except binascii.Error: # Incorrect padding pass elif cte in ('x-uuencode', 'uuencode', 'uue', 'x-uue'): in_file = BytesIO(payload.encode('raw-unicode-escape')) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4770> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com