From: Senthil Kumaran Date: Tue, 7 Dec 2010 07:10:04 +0000 (+0000) Subject: Fix Issue8194 - Fix incompatible API change in the parse_respones for xmlrpclib. X-Git-Tag: v2.7.2rc1~501 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d8e4edd5d2ece5e7016a7c3c35831e860c5c2039;p=thirdparty%2FPython%2Fcpython.git Fix Issue8194 - Fix incompatible API change in the parse_respones for xmlrpclib. --- diff --git a/Lib/xmlrpclib.py b/Lib/xmlrpclib.py index b6aed62e3b48..3cba39f59dcb 100644 --- a/Lib/xmlrpclib.py +++ b/Lib/xmlrpclib.py @@ -1446,8 +1446,13 @@ 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, else it is a file object + if hasattr(response,'getheader'): + if response.getheader("Content-Encoding", "") == "gzip": + stream = GzipDecodedResponse(response) + else: + stream = response else: stream = response