From 89b7e1d8648c000fed54e70e046edb9929a359ae Mon Sep 17 00:00:00 2001 From: wisp3rwind <17089248+wisp3rwind@users.noreply.github.com> Date: Thu, 4 May 2023 09:40:32 +0200 Subject: [PATCH] dbcore: bail out if the database does't support multi-threading which we rely on. This test doesn't actually work for Python < 3.11, since Python used to hardcode the threadsafety value to 1 --- beets/dbcore/db.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/beets/dbcore/db.py b/beets/dbcore/db.py index a3909cf14..6621b55d3 100755 --- a/beets/dbcore/db.py +++ b/beets/dbcore/db.py @@ -923,6 +923,11 @@ class Database: """ def __init__(self, path, timeout=5.0): + if sqlite3.threadsafety == 0: + raise RuntimeError( + "sqlite3 must be compiled with multi-threading support" + ) + self.path = path self.timeout = timeout