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 BitTorment, facundobatista, frispete, jjlee, orsenthil
Date 2008-08-01.06:12:21
SpamBayes Score 3.7050717e-07
Marked as misclassified No
Message-id <1217571144.69.0.26412253846.issue2275@psf.upfronthosting.co.za>
In-reply-to
Content
I am submitting a revised patch for this issue.
I did some analysis on the history of this issue and found that this
.capitalize() vs .title() changes had come up earlier too (
issue1542948)and decision was taken to:
- To retain the Header format in .capitalize() to maintain backward
compatibility.
- However, when the headers are passed to httplib, they are converted to
.title() format ( see AbstractHTTPHandler method )
- It is encouraged that users uses .add_header(), .has_header(),
.get_header() methods to check for headers instead of using the .headers
dict directly (which will still remain undocumented interface).

Note to Hans-Peter would be: Changing the headers to .title() tends to
make the .header_items() retrieval backward incompatible, so the headers
will still be stored in .capitalize() format.

And I have made the following changes to the patch:
1) Support for case insensitive dict look up which will work with for
.has_header, .get_header(). So when .has_header("User-Agent") will
return True even when .headers give {"User-agent":"blah"}
2) Added tests to tests the behavior.
3) Changes to doc to reflect upon this issue.

Btw, the undocumented .headers interface will also support
case-insensitive lookup, so I have added tests for that too.

Let me know if you have any comments. Lets plan to close this issue.

Thanks,
History
Date User Action Args
2008-08-01 06:12:24orsenthilsetrecipients: + orsenthil, facundobatista, jjlee, frispete, BitTorment
2008-08-01 06:12:24orsenthilsetmessageid: <1217571144.69.0.26412253846.issue2275@psf.upfronthosting.co.za>
2008-08-01 06:12:23orsenthillinkissue2275 messages
2008-08-01 06:12:21orsenthilcreate