From 46d667716ed98f797e069b52d744cdd46b14e0a2 Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 14 Dec 2023 10:49:10 +0000 Subject: [PATCH] support python 3.15 --- copyparty/u2idx.py | 4 ++-- copyparty/up2k.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/copyparty/u2idx.py b/copyparty/u2idx.py index 1d08b65b..e839fd67 100644 --- a/copyparty/u2idx.py +++ b/copyparty/u2idx.py @@ -103,7 +103,7 @@ class U2idx(object): uri = "" try: uri = "{}?mode=ro&nolock=1".format(Path(db_path).as_uri()) - db = sqlite3.connect(uri, 2, uri=True, check_same_thread=False) + db = sqlite3.connect(uri, timeout=2, uri=True, check_same_thread=False) cur = db.cursor() cur.execute('pragma table_info("up")').fetchone() self.log("ro: {}".format(db_path)) @@ -115,7 +115,7 @@ class U2idx(object): if not cur: # on windows, this steals the write-lock from up2k.deferred_init -- # seen on win 10.0.17763.2686, py 3.10.4, sqlite 3.37.2 - cur = sqlite3.connect(db_path, 2, check_same_thread=False).cursor() + cur = sqlite3.connect(db_path, timeout=2, check_same_thread=False).cursor() self.log("opened {}".format(db_path)) self.cur[ptop] = cur diff --git a/copyparty/up2k.py b/copyparty/up2k.py index 20494b5c..414f8c1f 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -2137,7 +2137,9 @@ class Up2k(object): self.log("ST: {}".format(msg)) def _orz(self, db_path: str) -> "sqlite3.Cursor": - c = sqlite3.connect(db_path, self.timeout, check_same_thread=False).cursor() + c = sqlite3.connect( + db_path, timeout=self.timeout, check_same_thread=False + ).cursor() # c.connection.set_trace_callback(self._trace) return c