diff options
author | Helmut Grohne <helmut@subdivi.de> | 2024-01-27 19:25:55 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2024-01-27 19:25:55 +0100 |
commit | 4119780c0fdde17b90340b6f8c0bb6b68f9c3c59 (patch) | |
tree | e5103eb9aa0d2f65b87370a3fe0245ef7d5b169b | |
parent | 9f7a434600f43c0e9ec45ca8569ca3c2fe3c269b (diff) | |
download | python-linuxnamespaces-4119780c0fdde17b90340b6f8c0bb6b68f9c3c59.tar.gz |
examples/chroottar.py: allow opening non-zstd tars
When decompression fails, we should raise a tarfile.ReadError rather
than a zstandard.ZstdError. Otherwise, tarfile gives up guessing.
-rwxr-xr-x | examples/chroottar.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/chroottar.py b/examples/chroottar.py index 56613de..ed494b2 100755 --- a/examples/chroottar.py +++ b/examples/chroottar.py @@ -38,7 +38,7 @@ class TarFile(tarfile.TarFile): zfobj = zstandard.open(name, "rb") try: tarobj = cls.taropen(name, "r", zfobj) - except (OSError, EOFError) as exc: + except (OSError, EOFError, zstandard.ZstdError) as exc: zfobj.close() raise tarfile.ReadError("not a zst file") from exc except: |