[Email-SIG] fixing the current email module

Barry Warsaw barry at python.org
Thu Oct 8 14:28:04 CEST 2009


On Oct 8, 2009, at 3:16 AM, R. David Murray wrote:

> I'd like to try to summarize what I understand Barry to be saying  
> (which,
> in this case, also reflects my understanding of what is needed), and
> see if I'm anywhere close to on target :)

Spot on, IMO!  I can only quibble about one thing, though I think it's  
just in the phrasing of what you wrote (or the way I read it), not in  
your understanding.

> An important property of the API is that both the parser that  
> transforms
> an input stream into a Message and Message serialization should not  
> raise
> exceptions except in the face of errors that leave no way to produce a
> valid Message or serialization.

I'd say it differently, since we all know you can encounter errors  
leaving invalid Messages.  The parser and generator should only raise  
exceptions when its basic assumptions (embodied as assertions  
probably) of the internal model are broken.  In almost all cases, I  
think those would be "bugs" :).

It may be in fact that the best you can do is produce a Message object  
with no headers and a big massive body containing everything else, and  
a huge defects list.

-Barry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 832 bytes
Desc: This is a digitally signed message part
URL: <http://mail.python.org/pipermail/email-sig/attachments/20091008/2add8f13/attachment.pgp>


More information about the Email-SIG mailing list