From 4802f8cf07dc13d966e23b4367402aaae97c2dfd Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 24 Aug 2021 00:24:50 +0200 Subject: [PATCH] better msg when unposting a deleted file --- copyparty/up2k.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/copyparty/up2k.py b/copyparty/up2k.py index 60814965..a7901dd8 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -1428,7 +1428,11 @@ class Up2k(object): ptop = vn.realpath atop = vn.canonical(rem, False) adir, fn = os.path.split(atop) - st = bos.lstat(atop) + try: + st = bos.lstat(atop) + except: + raise Pebkac(400, "file not found on disk (already deleted?)") + scandir = not self.args.no_scandir if stat.S_ISLNK(st.st_mode) or stat.S_ISREG(st.st_mode): dbv, vrem = self.asrv.vfs.get(vpath, uname, *permsets[0])