[issue12455] urllib2 forces title() on header names, breaking some requests

R. David Murray report at bugs.python.org
Fri Jul 1 09:45:44 CEST 2011


R. David Murray <rdmurray at bitdance.com> added the comment:

Quoting http://tools.ietf.org/html/rfc2068#section-4.2:

  Field names are case-insensitive.

Which is only logical, since they are modeled on email headers, and email header names are case insensitive.  So, the server in question is broken, yes, but that doesn't mean we can't provide a facility to allow Python to inter-operate with it.  Email, for example, preserves the case of the field names it parses or receives from the application program, but otherwise treats them case-insensitively.  However, since the current code coerces to title case, we have to provide this feature as a switchable facility defaulting to the current behavior, for backward compatibility reasons.

And someone needs to write a patch....

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12455>
_______________________________________


More information about the Python-bugs-list mailing list