Re: Bugs: Content-Length not updated by reused urllib.request.Request/ has_header() case-sensitive

Discussion in 'Python' started by Terry Reedy, Nov 13, 2012.

  1. Terry Reedy

    Terry Reedy Guest

    On 11/12/2012 5:59 PM, Cameron Simpson wrote:
    > On 12Nov2012 16:35, Terry Reedy <> wrote:
    > | On 11/12/2012 10:52 AM, Johannes Kleese wrote:
    > | > While at it, I noticed that urllib.request.Request.has_header() and
    > | > .get_header() are case-sensitive,
    > |
    > | Python is case sensitive.


    To be more precise, Python string comparisons are by codepoints. If one
    wants normalized comparison, one usually has to do do the normalization
    oneself.

    > But headers are not. I'd be very inclined to consider case sensitivity
    > in has_header and get_header to be a bug, absent a compelling argument
    > against it.


    It appears that the behavior is not consistent with doc examples and
    other header name handling. I added a note to
    http://bugs.python.org/issue12455

    --
    Terry Jan Reedy
    Terry Reedy, Nov 13, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    2,461
    Mark P
    Apr 6, 2007
  2. Chris McDonald
    Replies:
    0
    Views:
    275
    Chris McDonald
    Nov 1, 2010
  3. Xah Lee
    Replies:
    4
    Views:
    940
  4. Johannes Kleese
    Replies:
    4
    Views:
    251
    Terry Reedy
    Nov 27, 2012
  5. Cameron Simpson
    Replies:
    0
    Views:
    168
    Cameron Simpson
    Nov 12, 2012
Loading...

Share This Page