This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lemburg
Recipients amaury.forgeotdarc, beazley, flox, lemburg, vstinner
Date 2009-12-14.21:05:12
SpamBayes Score 2.074424e-08
Marked as misclassified No
Message-id <>
In-reply-to <>
flox wrote:
> flox <> 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/
--- Lib/email/	(revision 76839)
+++ Lib/email/	(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':

The patch also needs to fix the documentation and add a NEWS

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
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