Modify ↓
Opened 18 months ago
Last modified 18 months ago
#13607 assigned defect
sqlite3.version_info is deprecated since Python 3.12 and will be removed in Python 3.14
Reported by: | Jun Omae | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 1.6.1 |
Component: | database backend | Version: | |
Severity: | normal | Keywords: | sqlite |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
https://docs.python.org/3.12/library/sqlite3.html#sqlite3.version_info
After the following patch, it will retrieve pysqlite3.version_info
only when pysqlite3
is used.
-
contrib/make_status.py
diff --git a/contrib/make_status.py b/contrib/make_status.py index 65278624a..ab4962a8d 100755
a b PACKAGES = [ 51 51 ("Jinja2", 'jinja2.__version__'), 52 52 ("multipart", 'multipart.__version__'), 53 53 ("Babel", 'babel.__version__'), 54 ("sqlite3", ('sqlite3.version', 55 'sqlite3.sqlite_version')), 54 ("sqlite3", 'sqlite3.sqlite_version'), 56 55 ("PySqlite3", ('__main__._pysqlite3_version()', 57 56 'pysqlite3.dbapi2.sqlite_version')), 58 57 ("PyMySQL", 'pymysql.__version__'), -
trac/db/sqlite_backend.py
diff --git a/trac/db/sqlite_backend.py b/trac/db/sqlite_backend.py index dc0bf4ca9..8f38af387 100644
a b try: 37 37 import pysqlite3.dbapi2 as sqlite 38 38 except ImportError: 39 39 import sqlite3 as sqlite 40 pysqlite3_version = None 41 else: 42 pysqlite3_version = get_pkginfo(sqlite).get('version', '%d.%d.%s' % 43 sqlite.version_info) 40 44 41 45 sqlite_version = sqlite.sqlite_version_info 42 46 sqlite_version_string = sqlite.sqlite_version 43 pysqlite_version = sqlite.version_info44 pysqlite_version_string = get_pkginfo(sqlite).get('version',45 '%d.%d.%s'46 % pysqlite_version)47 47 min_sqlite_version = (3, 0, 0) 48 48 49 49 … … class SQLiteConnector(Component): 273 273 274 274 def get_system_info(self): 275 275 yield 'SQLite', sqlite_version_string 276 yield 'pysqlite', pysqlite_version_string 276 if pysqlite3_version: 277 yield 'pysqlite3', pysqlite3_version 277 278 278 279 @lazy 279 280 def _extensions(self): -
trac/tests/env.py
diff --git a/trac/tests/env.py b/trac/tests/env.py index e0f949949..80a700208 100644
a b class SystemInfoTestCase(unittest.TestCase): 520 520 self.assertEqual(info_before, info_after) 521 521 self.assertRegex(get_info(info_before, 'SQLite'), 522 522 r'^\d+(\.\d+)+$') 523 self.assertRegex(get_info(info_before, 'pysqlite'),524 r'^\d+(\.\d+)+$')525 523 else: 526 524 self.fail("Unknown value for dburi %s" % self.env.dburi) 527 525
Attachments (0)
Note:
See TracTickets
for help on using tickets.