Message96401
flox wrote:
>
> flox <laxyf@yahoo.fr> added the comment:
>
> This patch removes implicit encoding in binascii functions:
> - a2b_hex (=unhexlify)
> - a2b_qp
> - rledecode_hqx
>
> * Tests module "test_binascii" is reviewed and simplified.
> * Fixes for "email", "pickle" and "quopri" modules to encode input.
>
> All tests pass.
Are you sure that this patch is correct (which RFC says
that quoted printable should use our raw-unicode-escape
codec ?):
Index: Lib/email/message.py
===================================================================
--- Lib/email/message.py (revision 76839)
+++ Lib/email/message.py (working copy)
@@ -198,6 +198,8 @@
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:
The patch also needs to fix the documentation and add a NEWS
entry.
Making these APIs strict in the sense that they don't accept
str-instances anymore needs to be mentioned very clearly.
We may even have to go through a deprecation process for them,
since they can easily cause perfectly working code to suddenly
fail. |
|
Date |
User |
Action |
Args |
2009-12-14 21:05:19 | lemburg | set | recipients:
+ lemburg, beazley, amaury.forgeotdarc, vstinner, flox |
2009-12-14 21:05:12 | lemburg | link | issue4770 messages |
2009-12-14 21:05:12 | lemburg | create | |
|