Author r.david.murray
Recipients r.david.murray, tanzer@swing.co.at
Date 2015-11-03.19:59:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1446580793.55.0.26948453162.issue25545@psf.upfronthosting.co.za>
In-reply-to
Content
Your problem is that your input email is ia unicode string.  A unicode string has no RFC defintion as an email, so things do not work right, as you observed.  Whether or not email should throw an error when fed a non-ascii unicode string is an interesting question, but it hasn't in the past and so for backward compatibility reasons we won't change that.

If you add an "encode('utf-8')" to the end of your email string, and then use message_from_bytes, you will get the correct result.  You might also be interested in the newer email API, currently documented in the 'contentmanager' and 'policy' chapters of the documentation.  It says it is provisional, but the changes (other than bug fixes) between the current API and what will be final in 3.6 are trivial.

get_content_charset is None because you don't have any actual headers in your message, just body.  This is because of the leading newline in your triple quoted string, which the email package takes as the end of the headers.
History
Date User Action Args
2015-11-03 19:59:53r.david.murraysetrecipients: + r.david.murray, tanzer@swing.co.at
2015-11-03 19:59:53r.david.murraysetmessageid: <1446580793.55.0.26948453162.issue25545@psf.upfronthosting.co.za>
2015-11-03 19:59:53r.david.murraylinkissue25545 messages
2015-11-03 19:59:53r.david.murraycreate