[issue8572] httplib getheader() throws error instead of default

Walter Woods report at bugs.python.org
Wed May 5 17:31:43 CEST 2010


Walter Woods <woodswalben at gmail.com> added the comment:

Relevant part from trunk/Lib/rfc822.py illustrating that returning default unchanged is the legacy/defined behavior:

        return self.dict.get(name.lower(), default)

See attached patch for py3k.  This preserves backwards compatibility (aside from the comma-joined list) and uses the default argument appropriately (consistently with the default argument for dict.get, for instance).

On another note, should we be patching Python 2.7 as well, since RFC 2616 states that the 3.X behavior of a comma-joined list is appropriate (as cited  by Senthil)?

----------
Added file: http://bugs.python.org/file17222/issue8572-alt.diff

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


More information about the Python-bugs-list mailing list