Bug 788189 - Allow plague to work with sqlite3 from the stdlib
Summary: Allow plague to work with sqlite3 from the stdlib
Alias: None
Product: Fedora
Classification: Fedora
Component: plague
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Dan Williams
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2012-02-07 16:54 UTC by Toshio Ernie Kuratomi
Modified: 2012-03-02 01:23 UTC (History)
2 users (show)

Fixed In Version: plague-
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2012-03-02 01:23:26 UTC

Attachments (Terms of Use)
Patch to allow importing sqlite3 in place of pysqlite2 (3.12 KB, patch)
2012-02-07 16:54 UTC, Toshio Ernie Kuratomi
no flags Details | Diff

Description Toshio Ernie Kuratomi 2012-02-07 16:54:43 UTC
Created attachment 560007 [details]
Patch to allow importing sqlite3 in place of pysqlite2

Description of problem:

The python-sqlite2 owner would like to orphan and retire that package.  Plague is one of the last real dependencies on that module.  Need to port it to use the sqlite3 module from the python stdlib (2.5+) when that module is present.

Version-Release number of selected component (if applicable):


pysqlite2 and the sqlite3 module from the stdlib are supposed to be the same code base.  pysqlite2 is able to release more frequently since it isn't tied to python's release schedule.  However, they should be compatible.

I'm attaching a patch to plague that attempts to use sqlite3 in the same manner as pysqlite2 is used.  Note that I am not familiar with python-sqlite(1) so I'm not sure if we could be using the dbapi2 sqlite modules and doing this better.  This seemed like it was a less invasive change than looking at how dbapi2 might affect the code.  I did change the order of imports (so that pysqlite2 is tried first, then sqlite3, then sqlite) since sqlite has been deprecated for many years and it no longer exists on Fedora (where the retiring of python-sqlite2 will actually occur).

The patch also fixes a few places where error messages would actually result in tracebacks instead of doing what they were supposed to.  I just saw them when fixing the imports.

Comment 1 Michael Schwendt 2012-02-08 20:40:26 UTC
Well, I've tested the patch _unmodified_, dropped the python-sqlite2 Requires and erased python-sqlite2, then built a test package for Fedora 16. It works so far, i.e. plague-builder, plague-server, plague-client, plague-user-manager (also the included fix), and the web interface. Haven't run into any traceback or other error that would justify re-reviewing the ancient sqlite3 patch contents.

Comment 2 Fedora Update System 2012-02-17 23:37:50 UTC
plague- has been submitted as an update for Fedora 17.

Comment 3 Fedora Update System 2012-02-18 02:25:25 UTC
Package plague-
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing plague-'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2012-03-02 01:23:26 UTC
plague- has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.