This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author orsenthil
Recipients Walter.Woods, barry, hdiogenes, orsenthil, r.david.murray
Date 2010-04-30.02:26:03
SpamBayes Score 0.0018105864
Marked as misclassified No
Message-id <20100430022554.GA15689@remy>
In-reply-to <1272592554.53.0.227983318188.issue8572@psf.upfronthosting.co.za>
Content
On Fri, Apr 30, 2010 at 01:56:01AM +0000, R. David Murray wrote:
> 
> I seem to have been missing some context here. 

I was referring to Walter's comment on default being an int, like
HTTPResponse.getheader('Fake-Content-Length',default=42). It was
surprising to me, but the he provided a sample snippet and pointed out
that default value can be None. So, yes, just checking of string value
might not give the correct results in all circumstances (esp
default=None case which is strong).

>In the 2.x code getheader returns only the value of the first header
>with the given name, in the 3.x code it returns the comma separated
>concatenation of the values of all headers with that name, and breaks
>the handling of default.
> 
> Any idea which handling of header values is actually the correct
> behavior vis-a-vis the http protocol?

I believe, 2.x version is proper. I was surprised at get_all() method
introduced too, instead of getheader (if its present in Message)

Headers is a simply a dict and getheader is similar to dict.get(key,
default). I shall look up the HTTP RFC and confirm what should be done
if multiple values exists for same header.
History
Date User Action Args
2010-04-30 02:26:06orsenthilsetrecipients: + orsenthil, barry, hdiogenes, r.david.murray, Walter.Woods
2010-04-30 02:26:04orsenthillinkissue8572 messages
2010-04-30 02:26:03orsenthilcreate