Author karlcow
Recipients karlcow, orsenthil, r.david.murray
Date 2013-03-04.14:48:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1362408482.96.0.49074980962.issue17322@psf.upfronthosting.co.za>
In-reply-to
Content
R. David.:
> A crazy idea that occurred to me was to create an "rfc822-style-header management" module, and share it between email, http, and urllib.

Yes it is basically what I had in mind when I said:

>Maybe the way forward in the future is to have a header factory shared by all HTTP libs?

I'm not sure if it's easy to share in between emails and HTTP. Emails are now defined by RFC5322:
https://tools.ietf.org/html/rfc5322#section-2.2

2.2. Header Fields


   Header fields are lines beginning with a field name, followed by a
   colon (":"), followed by a field body, and terminated by CRLF.  A
   field name MUST be composed of printable US-ASCII characters (i.e.,
   characters that have values between 33 and 126, inclusive), except
   colon.  A field body may be composed of printable US-ASCII characters
   as well as the space (SP, ASCII value 32) and horizontal tab (HTAB,
   ASCII value 9) characters (together known as the white space
   characters, WSP).  A field body MUST NOT include CR and LF except
   when used in "folding" and "unfolding", as described in section
   2.2.3.  All field bodies MUST conform to the syntax described in
   sections 3 and 4 of this specification.

Maybe it's doable and worth exploring but I have the feeling we would end up with something along

field-name ":" field-value

and all the rules for field-name and field-value being different for HTTP and email, because they really are. Folding, set of characters, etc. :)

Another thing which should be also the opportunity for opening another issue. HTTP headers and python dictionaries is not a very good match. :) But this is drifting off-topic. :)
History
Date User Action Args
2013-03-04 14:48:03karlcowsetrecipients: + karlcow, orsenthil, r.david.murray
2013-03-04 14:48:02karlcowsetmessageid: <1362408482.96.0.49074980962.issue17322@psf.upfronthosting.co.za>
2013-03-04 14:48:02karlcowlinkissue17322 messages
2013-03-04 14:48:02karlcowcreate