Modify

Opened 16 years ago

Closed 16 years ago

Last modified 14 years ago

#4996 closed defect (fixed)

tags plugin fails on upgrading

Reported by: Jeff Hammel Owned by: osimons
Priority: normal Component: TagsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

When I enable the TagsPlugin on a fresh environment, and the upgrade never returns. Specifically, I get a ProgrammerError as the cursor is not fresh. The following patch fixes:

Index: tractags/model.py
===================================================================
--- tractags/model.py	(revision 5614)
+++ tractags/model.py	(working copy)
@@ -20,9 +20,9 @@
         self._upgrade_db(self.env.get_db_cnx())
 
     def environment_needs_upgrade(self, db):
-        cursor = db.cursor()
         if self._need_migration(db):
             return True
+        cursor = db.cursor()
         try:
             cursor.execute("select count(*) from tags")
             cursor.fetchone()

Attachments (1)

tagsplugin-model-r5614.diff (508 bytes) - added by Jeff Hammel 16 years ago.

Download all attachments as: .zip

Change History (8)

Changed 16 years ago by Jeff Hammel

Attachment: tagsplugin-model-r5614.diff added

comment:1 Changed 16 years ago by osimons

Owner: changed from Alec Thomas to osimons

I just noticed the problem when upgrading my pysqlite version (2.3.5 -> 2.5.5) - but on an environment that has been working with tags plugin for a long time.

Your patch makes sense and solves the issue for me too. I'll try to commit it (if I still have permissions).

comment:2 Changed 16 years ago by osimons

Resolution: fixed
Status: newclosed

(In [5655]) TagsPlugin: Fixed environment upgrade issue.

Closes #4996.

comment:3 Changed 16 years ago by osimons

Thanks for report and patch k0s!

Btw, are you using pysqlite 2.5.5 too? I have a feeling it is directly related to pysqlite that before let this slip through, but now catches the error.

comment:4 in reply to:  3 Changed 16 years ago by Jeff Hammel

Replying to osimons:

Thanks for report and patch k0s!

Btw, are you using pysqlite 2.5.5 too? I have a feeling it is directly related to pysqlite that before let this slip through, but now catches the error.

not sure, how do i find out the version number?

comment:5 Changed 16 years ago by osimons

See trac:wiki:PySqlite - try this:

python -c "import trac.db.sqlite_backend as s; print s.sqlite.version, s._ver"

It should give you the pysqlite version and the sqlite library version it is compiled against.

comment:6 in reply to:  5 Changed 16 years ago by Jeff Hammel

Replying to osimons:

See trac:wiki:PySqlite - try this:

python -c "import trac.db.sqlite_backend as s; print s.sqlite.version, s._ver"

It should give you the pysqlite version and the sqlite library version it is compiled against.

Thanks:

1.0.1 (2, 8, 17)

comment:7 Changed 14 years ago by Ryan J Ollos

This issue (or a very similar one) seems to still be present, see #7504 and #5345.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain osimons.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.