diff options
-rw-r--r-- | Lib/xmlrpclib.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/xmlrpclib.py b/Lib/xmlrpclib.py index b6aed62e3b..3cba39f59d 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 |