R. David Murray <rdmur...@bitdance.com> added the comment: Thanks, much easier to communicate when runnable code is involved :) Now I can see what you mean about it writing the From. I will figure out why and fix it so that the From line is not written.
The traceback from email.generator is unfortunate. I should have message_from-string reject non-ASCII input with a clear error message like mailbox.add does now, but I didn't think of it. I will see if the release manager will let me make that change. For case (2) it is working as designed: faithfully writing the non-conformant message to the mbox. If you wish to do other sorts of handling of non-conformant email you need to write code to do that. You can use the email package to make it technically conformant (and ASCII only) by doing something like message_from_string(str(message_from_bytes(non_conformant_message))) I'm not sure why you'd want to do that, though :) ---------- nosy: +georg.brandl _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11116> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com