class ZipOpen: def __init__(self, *args, **kwargs): self.fid = zip_ref.open(*args, **kwargs) def __enter__(self): self.tio = TextIOWrapper(self.fid) return self.tio.__enter__() def __exit__(self, exc_type, exc_val, exc_tb): return self.tio.__exit__(exc_type, exc_val, exc_tb)