]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix Issue8194 - Fix incompatible API change in the parse_respones for xmlrpclib.
authorSenthil Kumaran <orsenthil@gmail.com>
Tue, 7 Dec 2010 07:10:04 +0000 (07:10 +0000)
committerSenthil Kumaran <orsenthil@gmail.com>
Tue, 7 Dec 2010 07:10:04 +0000 (07:10 +0000)
Lib/xmlrpclib.py

index b6aed62e3b48667a52c1020a7c297e9132bfd96c..3cba39f59dcbef411ce5235bdc2d275b36c68eee 100644 (file)
@@ -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