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 Matthieu Pepin, barry, r.david.murray
Date 2015-11-16.23:14:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1447715691.12.0.415295495066.issue25640@psf.upfronthosting.co.za>
In-reply-to
Content
Ah, yes, that would do it.  EmailMessage should definitely throw an error if it gets compat32 as a policy, that would have told you what you were doing "wrong".

What you want to be doing is:

  msg = message_from_string(mystring, policy=default)

That will get you an EmailMessage object.  Note, however, that you almost never want message_from_string, because real email messages are bytes objects, not strings.  string only works if your message is ASCII only. (There's an open issue about documenting this properly...and a big doc revision in the offing.)
History
Date User Action Args
2015-11-16 23:14:51r.david.murraysetrecipients: + r.david.murray, barry, Matthieu Pepin
2015-11-16 23:14:51r.david.murraysetmessageid: <1447715691.12.0.415295495066.issue25640@psf.upfronthosting.co.za>
2015-11-16 23:14:51r.david.murraylinkissue25640 messages
2015-11-16 23:14:50r.david.murraycreate