fix zstd handling and github wrapper

This commit is contained in:
Dima Gerasimov 2020-05-04 18:14:15 +01:00 committed by karlicoss
parent 77d557e172
commit 3912ef2460
3 changed files with 15 additions and 14 deletions

View file

@ -9,12 +9,12 @@ import io
PathIsh = Union[Path, str]
def _zstd_open(path: Path, *args, **kwargs):
def _zstd_open(path: Path, *args, **kwargs) -> IO[str]:
import zstandard as zstd # type: ignore
fh = path.open(*args, **kwargs)
fh = path.open('rb')
dctx = zstd.ZstdDecompressor()
reader = dctx.stream_reader(fh)
return reader
return io.TextIOWrapper(reader, **kwargs) # meh
# TODO returns protocol that we can call 'read' against?