mirror of
https://github.com/9001/copyparty.git
synced 2025-08-20 10:22:21 -06:00
mute exception on zip abort
This commit is contained in:
parent
10430b347f
commit
2fb1e6dab8
|
@ -65,6 +65,7 @@ class StreamTar(StreamArc):
|
||||||
w.start()
|
w.start()
|
||||||
|
|
||||||
def gen(self) -> Generator[Optional[bytes], None, None]:
|
def gen(self) -> Generator[Optional[bytes], None, None]:
|
||||||
|
try:
|
||||||
while True:
|
while True:
|
||||||
buf = self.qfile.q.get()
|
buf = self.qfile.q.get()
|
||||||
if not buf:
|
if not buf:
|
||||||
|
@ -74,6 +75,7 @@ class StreamTar(StreamArc):
|
||||||
yield buf
|
yield buf
|
||||||
|
|
||||||
yield None
|
yield None
|
||||||
|
finally:
|
||||||
if self.errf:
|
if self.errf:
|
||||||
bos.unlink(self.errf["ap"])
|
bos.unlink(self.errf["ap"])
|
||||||
|
|
||||||
|
|
|
@ -272,6 +272,7 @@ class StreamZip(StreamArc):
|
||||||
|
|
||||||
def gen(self) -> Generator[bytes, None, None]:
|
def gen(self) -> Generator[bytes, None, None]:
|
||||||
errors = []
|
errors = []
|
||||||
|
try:
|
||||||
for f in self.fgen:
|
for f in self.fgen:
|
||||||
if "err" in f:
|
if "err" in f:
|
||||||
errors.append((f["vp"], f["err"]))
|
errors.append((f["vp"], f["err"]))
|
||||||
|
@ -280,6 +281,8 @@ class StreamZip(StreamArc):
|
||||||
try:
|
try:
|
||||||
for x in self.ser(f):
|
for x in self.ser(f):
|
||||||
yield x
|
yield x
|
||||||
|
except GeneratorExit:
|
||||||
|
raise
|
||||||
except:
|
except:
|
||||||
ex = min_ex(5, True).replace("\n", "\n-- ")
|
ex = min_ex(5, True).replace("\n", "\n-- ")
|
||||||
errors.append((f["vp"], ex))
|
errors.append((f["vp"], ex))
|
||||||
|
@ -307,6 +310,6 @@ class StreamZip(StreamArc):
|
||||||
|
|
||||||
ecdr, _ = gen_ecdr(self.items, cdir_pos, cdir_end)
|
ecdr, _ = gen_ecdr(self.items, cdir_pos, cdir_end)
|
||||||
yield self._ct(ecdr)
|
yield self._ct(ecdr)
|
||||||
|
finally:
|
||||||
if errors:
|
if errors:
|
||||||
bos.unlink(errf["ap"])
|
bos.unlink(errf["ap"])
|
||||||
|
|
Loading…
Reference in a new issue