R. David Murray <rdmur...@bitdance.com> added the comment:
Yeah, that looks like a bug in the old API. If you try the new API, it does the right thing. To do that, import email.policy and make your message_as_string call: email.message_from_string(raw, policy=email.policy.default) Note, however, that you really ought to be using message_from_bytes. Serialized email messages are bytes, not unicode, and using message_from_string will get you in to other trouble. I don't know if it is worth fixing the old API. ---------- title: email.parse part.get_filename() fails to unwrap long attachment file names -> email.parse part.get_filename() fails to unwrap long attachment file names (legacy API) _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue40359> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com