From 7685e9439aebc477cff56d9bd7edc8a806f55484 Mon Sep 17 00:00:00 2001 From: wisp3rwind <17089248+wisp3rwind@users.noreply.github.com> Date: Tue, 7 May 2024 23:55:44 +0200 Subject: [PATCH] db: disable DQS on Python >= 3.12 --- beets/dbcore/db.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/beets/dbcore/db.py b/beets/dbcore/db.py index 110cd70d0..5d721a121 100755 --- a/beets/dbcore/db.py +++ b/beets/dbcore/db.py @@ -1124,6 +1124,16 @@ class Database: # call conn.close() in _close() check_same_thread=False, ) + + if sys.version_info >= (3, 12) and sqlite3.sqlite_version_info >= ( + 3, + 29, + 0, + ): + # If possible, disable double-quoted strings + conn.setconfig(sqlite3.SQLITE_DBCONFIG_DQS_DDL, 0) + conn.setconfig(sqlite3.SQLITE_DBCONFIG_DQS_DML, 0) + self.add_functions(conn) if self.supports_extensions: