summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2024-01-27 19:25:55 +0100
committerHelmut Grohne <helmut@subdivi.de>2024-01-27 19:25:55 +0100
commit4119780c0fdde17b90340b6f8c0bb6b68f9c3c59 (patch)
treee5103eb9aa0d2f65b87370a3fe0245ef7d5b169b /examples
parent9f7a434600f43c0e9ec45ca8569ca3c2fe3c269b (diff)
downloadpython-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.
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/chroottar.py2
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: