Opened 8 years ago

Closed 7 years ago

#5245 closed defect (fixed)

rollback function not working with sqlite

Reported by: anonymous Owned by: Ryan J Ollos
Priority: normal Component: VotePlugin
Severity: normal Keywords: rollback sqlite3 sqlite
Cc: jjbig, Thijs Triemstra Trac Release: 0.11


what I did:

root@mail:~# easy_install

<added line "tracvote.* = enabled" to config

root@mail:~# trac-admin <DIR> upgrade Traceback (most recent call last):

File "/usr/bin/trac-admin", line 8, in <module>

load_entry_point('Trac==0.11.4', 'console_scripts', 'trac-admin')()

File "/usr/lib/python2.5/site-packages/Trac-0.11.4-py2.5.egg/trac/admin/", line 1317, in run

return admin.onecmd(command)

File "/usr/lib/python2.5/site-packages/Trac-0.11.4-py2.5.egg/trac/admin/", line 133, in onecmd

rv = cmd.Cmd.onecmd(self, line) or 0

File "/usr/lib/python2.5/", line 219, in onecmd

return func(arg)

File "/usr/lib/python2.5/site-packages/Trac-0.11.4-py2.5.egg/trac/admin/", line 1149, in do_upgrade

if not self.env.needs_upgrade():

File "/usr/lib/python2.5/site-packages/Trac-0.11.4-py2.5.egg/trac/", line 430, in needs_upgrade

if participant.environment_needs_upgrade(db):

File "build/bdist.linux-i686/egg/tracvote/", line 142, in environment_needs_upgrade File "/usr/lib/python2.5/site-packages/Trac-0.11.4-py2.5.egg/trac/db/", line 36, in getattr

return getattr(self.cursor, name)

AttributeError: 'PyFormatCursor' object has no attribute 'rollback'

root@mail:~# sqlite3 -version 3.4.2

Trac 0.11.4

Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2

Attachments (0)

Change History (6)

comment:1 Changed 8 years ago by fabien


I get the same error...

comment:2 Changed 8 years ago by fabien

Ok... I guess it should be db.rollback() and not cursor.rollback()

With that modification, it looks ok...

comment:3 Changed 8 years ago by Thijs Triemstra

Cc: Thijs Triemstra added

Yep, that fixes it:

  • tracvote/

    139139            cursor.fetchone()
    140140            return False
    141141        except:
    142             cursor.rollback()
     142            db.rollback()
    143143            return True
    145145    def upgrade_environment(self, db):

comment:4 Changed 8 years ago by anonymous

This change seems to be missing form the latest commit (6352). This was needed to install with the latest 0.11 release of Trac.


comment:5 Changed 7 years ago by Ryan J Ollos

Owner: changed from Alec Thomas to Ryan J Ollos

Reassigning ticket to new maintainer.

comment:6 Changed 7 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

Latest 0.11 version has cursor.connection.rollback(). Looks like this issue has been resolved. If you encounter the issue again, please reopen.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted.

Add Comment

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

Note: See TracTickets for help on using tickets.