John J Lee <[EMAIL PROTECTED]> added the comment: I have attached a patch that just:
* Improves doctests a bit * Changes .get_headers() and .has_header() to be case-insensitive * Documents .get_header() and .header_items(), fixes some incorrectly-documented argument names, and notes the case-sensitivity change * Note that the headers passed to httplib (the original issue for which this bug was raised) were already correctly Title-Cased, and that is unchanged by this patch Options: * Apply my patch. I'd be happy with this. * Apply my patch and begin the process of deprecating public interfaces .unredirected_hdrs and .headers. Perhaps provide another interface to tell whether a header will be redirected (only if there's a use case for that). I'd be happy with this too. * Bring back Senthil's case-normalized .headers and .unredirected_hdrs and document those interfaces. This a bad idea, because this would result in a very confusing set of interfaces for dealing with headers (see my previous comments on this -- Date: 2008-07-11 19:44). (For what it's worth, I have also attached a doctest to show some examples of the broken invariants issue with Senthil's patch. The doctest also comments on the fact that making .headers case-insensitive in this way is quite confusing in the case where multiple items of different case are present, but __getitem__ returns only a single item -- this is a relatively minor issue, but still worth avoiding. The variation of choosing to discard items that normalize to the same string would avoid this problem, though it might break working code that relies on sending multiple headers with differing case, so I think this would be no better overall.) Added file: http://bugs.python.org/file11886/issue2775.patch _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2275> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com