From 15a3ee252e05fa76e4698b4f560eae228e265ad3 Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 20 Jun 2021 15:50:06 +0200 Subject: [PATCH] support backslash in filenames --- copyparty/up2k.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/copyparty/up2k.py b/copyparty/up2k.py index 44712b3e..38482119 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -425,7 +425,10 @@ class Up2k(object): ret += self._build_dir(dbw, top, excl, abspath, nohash) else: # self.log("file: {}".format(abspath)) - rp = abspath[len(top) :].replace("\\", "/").strip("/") + rp = abspath[len(top) + 1 :] + if WINDOWS: + rp = rp.replace("\\", "/").strip("/") + rd, fn = rp.rsplit("/", 1) if "/" in rp else ["", rp] sql = "select w, mt, sz from up where rd = ? and fn = ?" try: