From efc6a09dd3dff2dae93289089ab1f370b3dbbe14 Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 14 Dec 2025 17:24:54 +0000 Subject: [PATCH] allow existing blank chpw.json (closes #1038); previously, would crash on startup if chpw.json exists and is blank, because valid json was enforced now allowing a blank initial file to match the behavior of sqlite --- copyparty/authsrv.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/copyparty/authsrv.py b/copyparty/authsrv.py index 0a77b685..008ff347 100644 --- a/copyparty/authsrv.py +++ b/copyparty/authsrv.py @@ -3306,7 +3306,7 @@ class AuthSrv(object): pwdb = {} else: jtxt = read_utf8(self.log, ap, True) - pwdb = json.loads(jtxt) + pwdb = json.loads(jtxt) if jtxt.strip() else {} pwdb = [x for x in pwdb if x[0] != uname] pwdb.append((uname, self.defpw[uname], hpw)) @@ -3330,7 +3330,7 @@ class AuthSrv(object): return jtxt = read_utf8(self.log, ap, True) - pwdb = json.loads(jtxt) + pwdb = json.loads(jtxt) if jtxt.strip() else {} useen = set() urst = set()