[Python-checkins] r87111 - python/branches/release27-maint/Lib/xmlrpclib.py

senthil.kumaran python-checkins at python.org
Tue Dec 7 08:10:04 CET 2010


Author: senthil.kumaran
Date: Tue Dec  7 08:10:04 2010
New Revision: 87111

Log:
Fix Issue8194  - Fix incompatible API change in the parse_respones for xmlrpclib.



Modified:
   python/branches/release27-maint/Lib/xmlrpclib.py

Modified: python/branches/release27-maint/Lib/xmlrpclib.py
==============================================================================
--- python/branches/release27-maint/Lib/xmlrpclib.py	(original)
+++ python/branches/release27-maint/Lib/xmlrpclib.py	Tue Dec  7 08:10:04 2010
@@ -1446,8 +1446,13 @@
 
     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
 


More information about the Python-checkins mailing list