Opened 18 years ago
Closed 18 years ago
#3753 closed enhancement (fixed)
Support the sqlite3 module that comes with Python 2.5
Reported by: | Christopher Lenz | Owned by: | Jonas Borgström |
---|---|---|---|
Priority: | high | Milestone: | 0.10 |
Component: | general | Version: | devel |
Severity: | normal | Keywords: | python25 review |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Now that Python 2.5 has been released, we should support the sqlite3
module that comes bundled.
The package name has been changed from pysqlite2.dbapi2
to sqlite3
, so an adjustment of Trac's sqlite_backend
is required. One open question is whether pysqlite2.dbapi2
should take precedence over sqlite3
or the other way around.
I'll attach a patch that adds support for sqlite3
, and prefers it to the standalone PySQLite driver.
Attachments (3)
Change History (11)
by , 18 years ago
Attachment: | sqlite3.diff added |
---|
comment:2 by , 18 years ago
Keywords: | review added |
---|
I think that pysqlite2 should take precedence over sqlite3 if it corresponds to a more recent version.
by , 18 years ago
Attachment: | sqlite3.2.diff added |
---|
Slightly modified patch: sqlite3 is still the preferred package, but if a more recent pysqlite2 is installed, prefer the latter one.
comment:3 by , 18 years ago
Keywords: | python25 added |
---|---|
Version: | 0.10b1 → devel |
Updated the patch. A typical scenario for this is that you have the need for a bug fix, then it's probably much easier to install the new pysqlite package from initd.org than to upgrade the bundled sqlite3 package. Or, you need to recompile pysqlite so that it uses a specific sqlite version (in that case, you'd also have to bump the PYSQLITE_VERSION in src/module.h to something higher than 2.3.2, which is sqlite3's version for the Python 2.5 release).
Besides this, I've successfully tested both sqlite3.diff and sqlite3.2.diff on the Genshi branch, using Python 2.5 freshly installed from the python-2.5.msi
Side-note: if we're to support python 2.5 for 0.10, we probably need to backport r3751 (or a better fix) on trunk.
comment:4 by , 18 years ago
I agree it should default to pysqlite2.dbapi2
. Don't see the point of the version comparison though, I'd rather keep the logic simple and always use PySQLite2 in preference to the bundled sqlite3
module.
Also agree about backporting r3751. Python 2.5 compatibility should definitely be a goal with 0.10.x.
comment:6 by , 18 years ago
Replying to cboos:
Ok, so attachment:sqlite3.3.diff should do the trick.
No, you reattached the second version of the patch.
comment:7 by , 18 years ago
Oops — fixed. As you can see, that's actually the same thing as cmlenz' first attempt, only the order of sqlite3 and pysqlite2 imports has been permuted.
comment:8 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Checked in the patch in [3754].
Sooo close to matching the ticket number to the changeset number here :-P
First attempt