mirror of
https://github.com/9001/copyparty.git
synced 2025-08-19 18:02:28 -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()
|
||||
|
||||
def gen(self) -> Generator[Optional[bytes], None, None]:
|
||||
try:
|
||||
while True:
|
||||
buf = self.qfile.q.get()
|
||||
if not buf:
|
||||
|
@ -74,6 +75,7 @@ class StreamTar(StreamArc):
|
|||
yield buf
|
||||
|
||||
yield None
|
||||
finally:
|
||||
if self.errf:
|
||||
bos.unlink(self.errf["ap"])
|
||||
|
||||
|
|
|
@ -272,6 +272,7 @@ class StreamZip(StreamArc):
|
|||
|
||||
def gen(self) -> Generator[bytes, None, None]:
|
||||
errors = []
|
||||
try:
|
||||
for f in self.fgen:
|
||||
if "err" in f:
|
||||
errors.append((f["vp"], f["err"]))
|
||||
|
@ -280,6 +281,8 @@ class StreamZip(StreamArc):
|
|||
try:
|
||||
for x in self.ser(f):
|
||||
yield x
|
||||
except GeneratorExit:
|
||||
raise
|
||||
except:
|
||||
ex = min_ex(5, True).replace("\n", "\n-- ")
|
||||
errors.append((f["vp"], ex))
|
||||
|
@ -307,6 +310,6 @@ class StreamZip(StreamArc):
|
|||
|
||||
ecdr, _ = gen_ecdr(self.items, cdir_pos, cdir_end)
|
||||
yield self._ct(ecdr)
|
||||
|
||||
finally:
|
||||
if errors:
|
||||
bos.unlink(errf["ap"])
|
||||
|
|
Loading…
Reference in a new issue