From 02e3d44998cf840a2531cc25ade0ebe695d27dcf Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 7 Sep 2021 21:20:34 +0200 Subject: [PATCH] fix move/delete without -e2d (thx exci) --- copyparty/up2k.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/copyparty/up2k.py b/copyparty/up2k.py index f6ed7599..6badc982 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -1455,12 +1455,14 @@ class Up2k(object): self.log("rm {}\n {}".format(vpath, abspath)) _ = dbv.get(volpath, uname, *permsets[0]) with self.mutex: + cur = None try: ptop = dbv.realpath cur, wark, _, _, _, _ = self._find_from_vpath(ptop, volpath) self._forget_file(ptop, volpath, cur, wark, True) finally: - cur.connection.commit() + if cur: + cur.connection.commit() bos.unlink(abspath) @@ -1583,7 +1585,7 @@ class Up2k(object): def _find_from_vpath(self, ptop, vrem): cur = self.cur.get(ptop) if not cur: - return None, None + return [None] * 6 rd, fn = vsplit(vrem) q = "select w, mt, sz, ip, at from up where rd=? and fn=? limit 1"