[Email-SIG] Append behavior of __setitem__

Barry Warsaw barry at python.org
Mon Apr 13 16:04:51 CEST 2009


On Apr 11, 2009, at 3:43 AM, Stephen J. Turnbull wrote:

> Barry Warsaw writes:
>
>> So I'm just starting to read RFC 5322 and I'm starting by skimming
>> over Appendix A (differences between RFC 5322 and 2822).
>
> I know Barry's a big supporter of the Postel Principle.  As a
> guideline[1], how far back should we be lenient?  RFC 822 (no  
> leading "2"
> ;-)?
>
> Footnotes:
> [1]  Presumably over time we'll accrete definitely non-conforming
> practices that we need to accept and do something sane with (eg, we
> can't just raise ArmageddonException because we get a header with
> 8-bit characters in it).  But I think we also should have a plan for
> formerly acceptable syntax that has been restricted in more recent
> RFCs, etc.

We could potentially have strict and lenient modes, or possible RFC  
822, 2822, 5322 modes.  OTOH, I feel very strongly that the parser  
should accept just about any stream of bytes without throwing an  
exception.  Thinking about an application like Mailman, it's rather  
inconvenient for the parsing phase to throw any exception.  Much  
better is to register defects and then decide the disposition of  
messages based on the defect list.

OTOH, when creating messages from whole cloth, I think it's okay to  
raise exception.  You just have to be careful because often the same  
APIs are used by the parser.

Barry

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


More information about the Email-SIG mailing list