Fix Issue8194 - Fix incompatible API change in the parse_respones for xmlrpclib.
authorSenthil Kumaran <orsenthil@gmail.com>
Wed, 8 Dec 2010 08:04:49 +0000 (08:04 +0000)
committerSenthil Kumaran <orsenthil@gmail.com>
Wed, 8 Dec 2010 08:04:49 +0000 (08:04 +0000)
Lib/xmlrpc/client.py

index 4de4c2b27dc429aec86bfd0128c3957f6a7983a3..19d4d6986fc3ffca4654b7a7e287a8b2ad217757 100644 (file)
@@ -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