From 62dc83327328c563c4220239b317d3ac6b001b40 Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 26 May 2026 17:47:52 +0000 Subject: [PATCH] misc linter --- copyparty/broker_util.py | 2 ++ copyparty/mtag.py | 4 ++-- copyparty/svchub.py | 7 ++++++- copyparty/th_srv.py | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/copyparty/broker_util.py b/copyparty/broker_util.py index 10c778dc..50264e83 100644 --- a/copyparty/broker_util.py +++ b/copyparty/broker_util.py @@ -16,6 +16,7 @@ if True: # pylint: disable=using-constant-test if TYPE_CHECKING: from .httpsrv import HttpSrv + from .svchub import SvcHub class ExceptionalQueue(Queue, object): @@ -50,6 +51,7 @@ class BrokerCli(object): for example resolving httpconn.* in httpcli -- see lines tagged #mypy404 """ + hub: "SvcHub" log: "RootLogger" args: argparse.Namespace asrv: AuthSrv diff --git a/copyparty/mtag.py b/copyparty/mtag.py index c25d4538..37e83a81 100644 --- a/copyparty/mtag.py +++ b/copyparty/mtag.py @@ -46,7 +46,7 @@ except: HAVE_MUTAGEN = False -def have_ff(name: str) -> bool: +def have_ff(name: str) -> bytes: uname = name.upper() if os.environ.get("PRTY_NO_" + uname): return b"" @@ -55,7 +55,7 @@ def have_ff(name: str) -> bool: try: bcmd = (ebin or name).encode("utf-8") except: - bcmd = ebin or name + bcmd: bytes = ebin or name if ANYWIN and not ebin: bcmd += b".exe" diff --git a/copyparty/svchub.py b/copyparty/svchub.py index 24f6007c..b0b1f9ef 100644 --- a/copyparty/svchub.py +++ b/copyparty/svchub.py @@ -1477,7 +1477,12 @@ class SvcHub(object): continue zi = signame2int(zs) setattr(self, mem, zi) - sigs.append(zi) + try: + sigs.append(signal.Signals(zi)) + except: + t = "using unknown signal %r as %s" + self.log("root", t % (zi, mem), 3) + sigs.append(zi) for sig in sigs: signal.signal(sig, self.signal_handler) diff --git a/copyparty/th_srv.py b/copyparty/th_srv.py index 0153bf0f..f1393a2e 100644 --- a/copyparty/th_srv.py +++ b/copyparty/th_srv.py @@ -790,7 +790,7 @@ class ThumbSrv(object): ) finally: if p and p.poll() is None: - p.kill(9) + p.kill() def _conv_rawpy(self, abspath: str, tpath: str, fmt: str, vn: VFS) -> None: self.wait4ram(0.6, tpath)