Message96402
> 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')) |
|
Date |
User |
Action |
Args |
2009-12-14 21:25:25 | flox | set | recipients:
+ flox, lemburg, beazley, amaury.forgeotdarc, vstinner |
2009-12-14 21:25:25 | flox | set | messageid: <1260825925.49.0.753289103795.issue4770@psf.upfronthosting.co.za> |
2009-12-14 21:25:24 | flox | link | issue4770 messages |
2009-12-14 21:25:23 | flox | create | |
|