MCPcopy Index your code
hub / github.com/python/cpython / GzipDecodedResponse

Class GzipDecodedResponse

Lib/xmlrpc/client.py:1065–1081  ·  view source on GitHub ↗

a file-like object to decode a response encoded with the gzip method, as described in RFC 1952.

Source from the content-addressed store, hash-verified

1063# @return a file-like object that the decoded data can be read() from
1064
1065class GzipDecodedResponse(gzip.GzipFile if gzip else object):
1066 """a file-like object to decode a response encoded with the gzip
1067 method, as described in RFC 1952.
1068 """
1069 def __init__(self, response):
1070 #response doesn't support tell() and read(), required by
1071 #GzipFile
1072 if not gzip:
1073 raise NotImplementedError
1074 self.io = BytesIO(response.read())
1075 gzip.GzipFile.__init__(self, mode="rb", fileobj=self.io)
1076
1077 def close(self):
1078 try:
1079 gzip.GzipFile.close(self)
1080 finally:
1081 self.io.close()
1082
1083
1084# --------------------------------------------------------------------

Callers 1

parse_responseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…