From fa12c81a03754f7c997c0007969779d32de2b302 Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 24 Mar 2022 01:31:50 +0100 Subject: [PATCH] zip-download files older than 1980-01-01 --- copyparty/star.py | 7 ++++--- copyparty/szip.py | 13 ++++++++----- copyparty/util.py | 4 ++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/copyparty/star.py b/copyparty/star.py index d771a1c6..b560f9d5 100644 --- a/copyparty/star.py +++ b/copyparty/star.py @@ -5,7 +5,7 @@ import tarfile import threading from .sutil import errdesc -from .util import Queue, fsenc +from .util import Queue, fsenc, min_ex from .bos import bos @@ -88,8 +88,9 @@ class StreamTar(object): try: self.ser(f) - except Exception as ex: - errors.append([f["vp"], repr(ex)]) + except Exception: + ex = min_ex(5, True).replace("\n", "\n-- ") + errors.append([f["vp"], ex]) if errors: self.errf, txt = errdesc(errors) diff --git a/copyparty/szip.py b/copyparty/szip.py index 1859e91b..8e18eace 100644 --- a/copyparty/szip.py +++ b/copyparty/szip.py @@ -1,13 +1,12 @@ # coding: utf-8 from __future__ import print_function, unicode_literals -import os import time import zlib from datetime import datetime from .sutil import errdesc -from .util import yieldfile, sanitize_fn, spack, sunpack +from .util import yieldfile, sanitize_fn, spack, sunpack, min_ex from .bos import bos @@ -36,7 +35,10 @@ def unixtime2dos(ts): bd = ((dy - 1980) << 9) + (dm << 5) + dd bt = (th << 11) + (tm << 5) + ts // 2 - return spack(b"