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 Tim.Rawlinson
Recipients Tim.Rawlinson, barry, docs@python, r.david.murray
Date 2013-05-23.11:57:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In Python 3.3 decoding of headers to unicode is supposed to be automatic but fails in several cases, including one shown as successful in the documentation:

   >>> msg = message_from_string('Subject: =?utf-8?q?=C3=89ric?=\n\n', policy=default)
   >>> msg['Subject']

   >>> msg = message_from_string('To: =?utf-8?q?=C3=89ric <>\n\n', policy=default)
   >>> msg['To']
   '=?utf-8?q?=C3=89ric?= <>'

Although the following works:

   >>> msg = message_from_string('Subject: =?utf-8?q?Eric?=\n\n', policy=default)
   >>> msg['Subject']

Though this does not:

   >>> msg = message_from_string('To: =?utf-8?q?Eric?= <>\n\n', policy=default)
   >>> msg['To']
   '=?utf-8?q?Eric?= <>'

And just to prove some things are working as they should:

    >>> msg = message_from_string("Subject: =?gb2312?b?1eLKx9bQzsSy4srUo6E=?=\n\n", policy=default)
    >>> msg['Subject']
Date User Action Args
2013-05-23 11:57:36Tim.Rawlinsonsetrecipients: + Tim.Rawlinson, barry, r.david.murray, docs@python
2013-05-23 11:57:36Tim.Rawlinsonsetmessageid: <>
2013-05-23 11:57:36Tim.Rawlinsonlinkissue18044 messages
2013-05-23 11:57:35Tim.Rawlinsoncreate