diff --git a/copyparty/__main__.py b/copyparty/__main__.py index 8f2360de..edf90044 100644 --- a/copyparty/__main__.py +++ b/copyparty/__main__.py @@ -896,7 +896,7 @@ def get_sects(): dedent( """ the mDNS protocol is multicast-based, which means there are thousands - of fun and intersesting ways for it to break unexpectedly + of fun and interesting ways for it to break unexpectedly things to check if it does not work at all: diff --git a/copyparty/authsrv.py b/copyparty/authsrv.py index d50ea173..0d68cf13 100644 --- a/copyparty/authsrv.py +++ b/copyparty/authsrv.py @@ -924,7 +924,7 @@ class AuthSrv(object): for un, gn in un_gn: # if ap/vp has a user/group placeholder, make sure to keep - # track so the same user/gruop is mapped when setting perms; + # track so the same user/group is mapped when setting perms; # otherwise clear un/gn to indicate it's a regular volume src1 = src0.replace("${u}", un or "\n") diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 8131e54a..8989fb1f 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -3045,7 +3045,7 @@ class HttpCli(object): if ex.errno != errno.ENOENT: raise - # if file exists, chekc that timestamp matches the client's + # if file exists, check that timestamp matches the client's if srv_lastmod >= 0: same_lastmod = cli_lastmod3 in [-1, srv_lastmod3] if not same_lastmod: @@ -4789,7 +4789,7 @@ class HttpCli(object): fmt = fmt.format(len(nfmt.format(biggest))) retl = [ - "# {}: {}".format(x, ls[x]) + ("# %s: %s" % (x, ls[x])).replace(r" // ", " // ") for x in ["acct", "perms", "srvinf"] if x in ls ] diff --git a/copyparty/mtag.py b/copyparty/mtag.py index 59a5ab16..99868e40 100644 --- a/copyparty/mtag.py +++ b/copyparty/mtag.py @@ -473,7 +473,7 @@ class MTag(object): sv = str(zv).split("/")[0].strip().lstrip("0") ret[sk] = sv or 0 - # normalize key notation to rkeobo + # normalize key notation to rekobo okey = ret.get("key") if okey: key = str(okey).replace(" ", "").replace("maj", "").replace("min", "m") diff --git a/copyparty/ssdp.py b/copyparty/ssdp.py index 5f8de79d..e95bf69e 100644 --- a/copyparty/ssdp.py +++ b/copyparty/ssdp.py @@ -84,7 +84,7 @@ class SSDPr(object): name = self.args.doctitle zs = zs.strip().format(c(ubase), c(url), c(name), c(self.args.zsid)) hc.reply(zs.encode("utf-8", "replace")) - return False # close connectino + return False # close connection class SSDPd(MCast): diff --git a/copyparty/tcpsrv.py b/copyparty/tcpsrv.py index f4d97bed..88aa654a 100644 --- a/copyparty/tcpsrv.py +++ b/copyparty/tcpsrv.py @@ -95,7 +95,7 @@ class TcpSrv(object): continue # binding 0.0.0.0 after :: fails on dualstack - # but is necessary on non-dualstakc + # but is necessary on non-dualstack if successful_binds: continue diff --git a/copyparty/util.py b/copyparty/util.py index 33f79ba3..e14b3732 100644 --- a/copyparty/util.py +++ b/copyparty/util.py @@ -1163,7 +1163,7 @@ class Magician(object): return ret mime = magic.from_file(fpath, mime=True) - mime = re.split("[; ]", mime, 1)[0] + mime = re.split("[; ]", mime, maxsplit=1)[0] try: return EXTS[mime] except: diff --git a/docs/devnotes.md b/docs/devnotes.md index 571e7b95..af6e1117 100644 --- a/docs/devnotes.md +++ b/docs/devnotes.md @@ -279,6 +279,7 @@ the rest is mostly optional; if you need a working env for vscode or similar python3 -m venv .venv . .venv/bin/activate pip install jinja2 strip_hints # MANDATORY +pip install argon2-cffi # password hashing pip install mutagen # audio metadata pip install pyftpdlib # ftp server pip install partftpy # tftp server diff --git a/scripts/help2html.py b/scripts/help2html.py index 89aec2f5..7bd3318a 100755 --- a/scripts/help2html.py +++ b/scripts/help2html.py @@ -71,7 +71,7 @@ def cnv(src): def main(): src = readclip() - src = re.split("0{100,200}", src[::-1], 1)[1][::-1] + src = re.split("0{100,200}", src[::-1], maxsplit=1)[1][::-1] with open("helptext.html", "wb") as fo: for ln in cnv(iter(src.split("\n")[:-3])): fo.write(ln.encode("utf-8") + b"\r\n")