From: Senthil Kumaran Date: Wed, 8 Dec 2010 08:04:49 +0000 (+0000) Subject: Fix Issue8194 - Fix incompatible API change in the parse_respones for xmlrpclib. X-Git-Tag: v3.2b2~177 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f34445f7bd30d3fe1fb9c5a5a87f10225a6372a3;p=thirdparty%2FPython%2Fcpython.git Fix Issue8194 - Fix incompatible API change in the parse_respones for xmlrpclib. --- diff --git a/Lib/xmlrpc/client.py b/Lib/xmlrpc/client.py index 4de4c2b27dc4..19d4d6986fc3 100644 --- a/Lib/xmlrpc/client.py +++ b/Lib/xmlrpc/client.py @@ -1297,8 +1297,12 @@ class Transport: def parse_response(self, response): # read response data from httpresponse, and parse it - if response.getheader("Content-Encoding", "") == "gzip": - stream = GzipDecodedResponse(response) + # Check for new http response object, otherwise it is a file object. + if hasattr(response, 'getheader'): + if response.getheader("Content-Encoding", "") == "gzip": + stream = GzipDecodedResponse(response) + else: + stream = response else: stream = response