From 760ff2db721240951ddef1a7b65a07d94766e325 Mon Sep 17 00:00:00 2001 From: ed Date: Sat, 13 Jul 2024 01:18:14 +0200 Subject: [PATCH] other linter nitpicks (not actually bugs) --- copyparty/httpcli.py | 3 ++- copyparty/mdns.py | 2 +- copyparty/mtag.py | 3 +++ copyparty/ssdp.py | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 010c86ff..77f4a23d 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -748,7 +748,7 @@ class HttpCli(object): or ("; Trident/" in self.ua and not k304) ) - def _build_html_head(self, maybe_html: Any, kv: dict[str, Any]) -> bool: + def _build_html_head(self, maybe_html: Any, kv: dict[str, Any]) -> None: html = str(maybe_html) is_jinja = html[:2] in "%@%" if is_jinja: @@ -3075,6 +3075,7 @@ class HttpCli(object): logtail = "" if ptop is not None: + ap_data = "<%s>" % (req_path,) try: dp, fn = os.path.split(req_path) tnam = fn + ".PARTIAL" diff --git a/copyparty/mdns.py b/copyparty/mdns.py index 3a4a7f2d..849c8417 100644 --- a/copyparty/mdns.py +++ b/copyparty/mdns.py @@ -361,7 +361,7 @@ class MDNS(MCast): except: pass - self.srv = {} + self.srv.clear() def eat(self, buf: bytes, addr: tuple[str, int], sck: socket.socket) -> None: cip = addr[0] diff --git a/copyparty/mtag.py b/copyparty/mtag.py index 2a6d226c..77421bf2 100644 --- a/copyparty/mtag.py +++ b/copyparty/mtag.py @@ -139,6 +139,9 @@ def au_unpk( zil = [x for x in zil if x.filename.lower().split(".")[-1] == au] fi = zf.open(zil[0]) + else: + raise Exception("unknown compression %s" % (pk,)) + with os.fdopen(fd, "wb") as fo: while True: buf = fi.read(32768) diff --git a/copyparty/ssdp.py b/copyparty/ssdp.py index 81958b05..f663d99b 100644 --- a/copyparty/ssdp.py +++ b/copyparty/ssdp.py @@ -188,7 +188,7 @@ class SSDPd(MCast): except: pass - self.srv = {} + self.srv.clear() def eat(self, buf: bytes, addr: tuple[str, int]) -> None: cip = addr[0]