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 r.david.murray
Recipients georg.brandl, giampaolo.rodola, holdenweb, lregebro, pitrou, r.david.murray, rhettinger, sdaoden, vstinner
Date 2011-01-28.20:58:22
SpamBayes Score 0.0001126693
Marked as misclassified No
Message-id <1296248303.19.0.710873101882.issue9124@psf.upfronthosting.co.za>
In-reply-to
Content
Well, that's a bunch of code, and I'm afraid I don't know what your answer to my question was.  What error do you get now if you use the new version of mailbox3.patch?

If you feed the new mailbox/email bytes, it will preserve the bytes as is, as long as you don't try to convert the invalid headers to strings.  If you convert them to string (by accessing them through the Message object), it will encode them as 'unknown-8bit' using quopri or base64 as appropriate (ie: depending on how many non-ascii chars there are).  If you want instead to guess that they are latin-1, you can call decode_header on the stringified version to get back the original bytes, and then substitute your preferred guessed charset for the 'unknown-8bit' charset and go from there to unicode.  (For Python3.3 I plan to provide tools to make this kind of processing much simpler.)
History
Date User Action Args
2011-01-28 20:58:23r.david.murraysetrecipients: + r.david.murray, georg.brandl, rhettinger, holdenweb, pitrou, vstinner, giampaolo.rodola, lregebro, sdaoden
2011-01-28 20:58:23r.david.murraysetmessageid: <1296248303.19.0.710873101882.issue9124@psf.upfronthosting.co.za>
2011-01-28 20:58:22r.david.murraylinkissue9124 messages
2011-01-28 20:58:22r.david.murraycreate