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

Walter Woods report at bugs.python.org
Mon Aug 2 00:18:21 CEST 2010


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

Hi David,

I like most of your patch (especially since it has unit tests), and if people like yourself are actually using the current functionality then that's fine, but one recommendation: why not change this line:

if not headers or isinstance(headers, str):

To also include the clause ``or getattr(headers, '__iter__', False)``.  That way, other default values (such as numbers) would work as expected rather than throw an error.  What do you think of that?

----------

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


More information about the Python-bugs-list mailing list