Edgewall Software
Modify

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)

sqlite3.diff (3.1 KB ) - added by Christopher Lenz 18 years ago.
First attempt
sqlite3.2.diff (3.5 KB ) - added by Christian Boos 18 years ago.
Slightly modified patch: sqlite3 is still the preferred package, but if a more recent pysqlite2 is installed, prefer the latter one.
sqlite3.3.diff (3.1 KB ) - added by Christian Boos 18 years ago.
Always prefer pysqlite2 over sqlite3 — take 2

Download all attachments as: .zip

Change History (11)

by Christopher Lenz, 18 years ago

Attachment: sqlite3.diff added

First attempt

comment:1 by Christopher Lenz, 18 years ago

Can someone review this patch before we check it in?

comment:2 by Christian Boos, 18 years ago

Keywords: review added

I think that pysqlite2 should take precedence over sqlite3 if it corresponds to a more recent version.

by Christian Boos, 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 Christian Boos, 18 years ago

Keywords: python25 added
Version: 0.10b1devel

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 Christopher Lenz, 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:5 by Christian Boos, 18 years ago

Ok, so attachment:sqlite3.3.diff should do the trick.

in reply to:  5 comment:6 by Matthew Good, 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.

by Christian Boos, 18 years ago

Attachment: sqlite3.3.diff added

Always prefer pysqlite2 over sqlite3 — take 2

comment:7 by Christian Boos, 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 Christopher Lenz, 18 years ago

Resolution: fixed
Status: newclosed

Checked in the patch in [3754].

Sooo close to matching the ticket number to the changeset number here :-P

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.