Opened 5 years ago

Closed 4 years ago

#5245 closed defect (fixed)

rollback function not working with sqlite

Reported by: anonymous Owned by: rjollos
Priority: normal Component: VotePlugin
Severity: normal Keywords: rollback sqlite3 sqlite
Cc:…, thijs 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

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 5 years ago by fabien


I get the same error...

comment:2 Changed 5 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 5 years ago by thijs

  • Cc thijs 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 5 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 4 years ago by rjollos

  • Owner changed from athomas to rjollos

Reassigning ticket to new maintainer.

comment:6 Changed 4 years ago by rjollos

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from rjollos. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.

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

Note: See TracTickets for help on using tickets.