From c7c6e48b1aef6cb806f62395283a1c63ad201389 Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 9 Mar 2023 21:59:59 +0000 Subject: [PATCH] didn't compress numbered logfiles --- copyparty/svchub.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/copyparty/svchub.py b/copyparty/svchub.py index c3a74f47..a8bcf5b7 100644 --- a/copyparty/svchub.py +++ b/copyparty/svchub.py @@ -402,6 +402,7 @@ class SvcHub(object): def _setup_logfile(self, printed: str) -> None: base_fn = fn = sel_fn = self._logname() + do_xz = fn.lower().endswith(".xz") if fn != self.args.lo: ctr = 0 # yup this is a race; if started sufficiently concurrently, two @@ -413,7 +414,7 @@ class SvcHub(object): fn = sel_fn try: - if fn.lower().endswith(".xz"): + if do_xz: import lzma lh = lzma.open(fn, "wt", encoding="utf-8", errors="replace", preset=0)