R. David Murray added the comment: This isn't the place to get help on Python coding, but since this is a relatively new API I'll give you a pointer, and then you can tell me where the docs need improvement :)
If you do message_from_string(yourstring, policy=email.policy.default), you should get back an EmailMessage object. That said, your example does return an EmailMessage for me, if I put a string in place of your self.original_message, which must be something from your program. However, that won't *work* very well, because the policy is set to Compat32, and Compat32 and EmailMessage aren't designed to work together. A lot of things will work fine, but you'll get some weird errors. However, I don't think that that is worth a documentation note, since it is a logical consequence of using _class=EmailMessage without specifying a policy. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30706> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com