def parse_response_gzip(self, f): """Workaround M2Crypto issue mentioned above.""" sio = StringIO() while 1: chunk = f.read() if not chunk: break sio.write(chunk) sio.seek(0) return Transport.parse_response_gzip(self, sio)