New submission from Walter Woods <[email protected]>:
Calling HTTPResponse.getheader('Testabnew', 'Default') throws an exception
rather than returning default, python 3.1.2. Problem code appears to be line
601 of client.py:
def getheader(self, name, default=None):
if self.headers is None:
raise ResponseNotReady()
- return ', '.join(self.headers.get_all(name, default))
Which should probably changed to:
+ result = self.headers.get_all(name, None)
+ if result:
+ return ', '.join(result)
+ else:
+ return default
Not as elegant, but what appears to happen is if default is not an array, then
get_all returns it, and the string join fails with a TypeError.
----------
messages: 104532
nosy: Walter.Woods
priority: normal
severity: normal
status: open
title: httplib getheader() does not work as documented
type: crash
versions: Python 3.1
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue8572>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com