From 2ccca9499240b79a3dc9ccc25bb1fab5c4dfce45 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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/beets/dbcore/db.py b/beets/dbcore/db.py index 4645d4b096..00bab9e00a 100755 --- a/beets/dbcore/db.py +++ b/beets/dbcore/db.py @@ -20,6 +20,7 @@ import os import re import sqlite3 +import sys import threading import time from abc import ABC @@ -1091,6 +1092,12 @@ def _create_connection(self) -> Connection: # 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: