This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Walter.Woods
Recipients Walter.Woods
Date 2010-04-29.15:57:11
SpamBayes Score 0.013120463
Marked as misclassified No
Message-id <1272556633.35.0.699750313989.issue8572@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-04-29 15:57:13Walter.Woodssetrecipients: + Walter.Woods
2010-04-29 15:57:13Walter.Woodssetmessageid: <1272556633.35.0.699750313989.issue8572@psf.upfronthosting.co.za>
2010-04-29 15:57:12Walter.Woodslinkissue8572 messages
2010-04-29 15:57:11Walter.Woodscreate