On Wed, 02 Mar 2011 21:40:39 +0100, Steffen Daode Nurpmeso <sdao...@googlemail.com> wrote: > But if "what goes in .defects[]" will be configurable i would hope > for a generic is_malformed() and maybe is_processable() or the > like, i.e. state versus (translatable?) user-info.
I'm not sure what you are asking for here. I think "if msg.is_malformed()" is spelled "if msg.defects". That is, if the defects list is non-empty, the message is technically malformed. Of course, that information by itself isn't necessarily useful, which is why defects is a list of defects. "is_processable" lies in the eyes of the application. What defects is it capable of dealing with? The email package can't know that. So, again, that's why defects is a list. Let me clarify what I mean by the policy controlling "what, exactly, is a defect". The idea here is that when parsing an email, each deviance from the RFCs counts as a defect (the current email package, by the way, only detects a small number of such defects!). But when parsing, say, an http stream, non-ascii characters in headers are perfectly legal. So it seems to make sense that the HTTP policy would change what counts as a defect during the operation of the parser. > (The more i think about it the more i agree with David (i hope > i don't lie about that) that it's a waste of time to try to > convert malformed data to a compliant state, especially if the > package is - by design - capable to spit out the data the very > same way it came in. Someone will take care - and throw it away.) Well, I think we may provide some tools to do such "fixups" when it is possible and the application wants it. But they should be app-requested transformations, not automatic ones. > Unfortunately my non-hate mail seems to have been mistreated as > spam 8-}, therefore i wrote all of the above just to thank David > once again for making the email and mailbox packages usable > already in Python 3.2. Thanks. You are welcome :) --David _______________________________________________ Email-SIG mailing list Email-SIG@python.org Your options: http://mail.python.org/mailman/options/email-sig/archive%40mail-archive.com