Author lemburg
Recipients amaury.forgeotdarc, beazley, flox, lemburg, vstinner
Date 2009-12-14.21:05:12
SpamBayes Score 2.07442e-08
Marked as misclassified No
Message-id <4B26A886.6020308@egenix.com>
In-reply-to <1260822221.89.0.89036898713.issue4770@psf.upfronthosting.co.za>
Content
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.
History
Date User Action Args
2009-12-14 21:05:19lemburgsetrecipients: + lemburg, beazley, amaury.forgeotdarc, vstinner, flox
2009-12-14 21:05:12lemburglinkissue4770 messages
2009-12-14 21:05:12lemburgcreate