When the tarball is too heavy, don't display its content

This avoid an infinite wait due to a full buffer
master
nemunaire 3 months ago
parent 5d5c9d3e7c
commit eff10e0cda
  1. 4
      archive.py

@ -104,10 +104,12 @@ def extract(cnt, dest=None):
with tempfile.TemporaryDirectory() as temp:
cmdline = ["tar", "--no-same-owner", "--no-same-permissions"]
if dest is not None:
cmdline.append("-xvC")
cmdline.append("-xC")
cmdline.append(temp)
else:
cmdline.append("-t")
if len(data) < 3145728:
cmdline.append("-v")
if type in ["application/gzip", "application/x-gzip"]:
cmdline.append("-z")
elif type in ["application/xz", "application/x-xz"]:

Loading…
Cancel
Save