[Python-Dev] Patch making the current email package (mostly) support bytes (original) (raw)

Barry Warsaw barry at python.org
Thu Oct 7 20:37:48 CEST 2010


On Oct 07, 2010, at 04:40 AM, Stephen J. Turnbull wrote:

> And the email API currently promises not to raise during parsing, > which is a contract my patch does not change.

Which is a contract that has historically been broken frequently. Unhandled UnicodeErrors have been one of the most common causes of queue stoppage in Mailman (exceeded only by configuration errors AFAICS). I haven't seen any reports for a while, but with the email package being reengineered from the ground up, the possibility of regression can't be ignored.

I'm fairly certain that most of the modern causes of this are post-parse modifications of the message. IOW, in Mailman's architecture, we try to parse the raw data into a Message object tree very early in the pipeline, and then a pickled version of that gets passed between the queue runners. If the initial parse fails, there's almost literally nothing Mailman can do with the original data other than delete it.

Where we've gotten into trouble before has been things like adding the Subject prefixes and such. That seems like application logic that the email package can't really get involved with, and indeed Mailman has built up a raft of defense for failures of this kind.

-Barry -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: not available URL: <http://mail.python.org/pipermail/python-dev/attachments/20101007/df675e61/attachment.pgp>



More information about the Python-Dev mailing list