Ticket #9908 (assigned defect)

Opened 1 year ago

Last modified 7 months ago

TeamCalendarPlugin works partially

Reported by: gmanukya@jpl.nasa.gov Assigned to: ChrisNelson (accepted)
Priority: high Component: TeamCalendarPlugin
Severity: major Keywords:
Cc: Trac Release: 0.12

Description (Last modified by rjollos)

Hi,

I have instaleld TeamCalendarPlugin and edited the trac.db with sqlite3 as instructed. The new tab "Team Calendar" showed up on the top right corner as promised.

When I go there and select the dates for users then I click "Apply Changes" button I get the following error message:

Most recent call last:

File "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/web/main.py", line 511, in _dispatch_request
  dispatcher.dispatch(req)
File "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/web/main.py", line 237, in dispatch
  resp = chosen_handler.process_request(req)
File "/usr/lib/python2.6/site-packages/teamcalendar-0.1-py2.6.egg/teamcalendar/calendar.py", line 246, in process_request
  self.update_timetable(tuples)
File "/usr/lib/python2.6/site-packages/teamcalendar-0.1-py2.6.egg/teamcalendar/calendar.py", line 168, in update_timetable
  flat)
File "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/db/util.py", line 65, in execute
  return self.cursor.execute(sql_escape_percent(sql), args)
File "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/db/sqlite_backend.py", line 78, in execute
  result = PyFormatCursor.execute(self, *args)
File "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/db/sqlite_backend.py", line 56, in execute
  args or [])
File "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/db/sqlite_backend.py", line 48, in _rollback_on_error
  return function(self, *args, **kwargs)
Here is some info about the system:
Trac 	0.12.2
Babel 	0.9.4
Docutils 	0.6
Genshi 	0.6
Pygments 	1.1.1
pysqlite 	2.6.3
Python 	2.6.6 (r266:84292, Dec 7 2011, 20:38:36) [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)]
pytz 	2010h
setuptools 	0.6
SQLite 	3.6.20
Subversion 	1.6.11 (r934486)
jQuery:	1.4.2

Installed Plugins:

Default-CC 	0.1 	/usr/lib/python2.6/site-packages/Default_CC-0.1-py2.6.egg
teamcalendar 	0.1 	/usr/lib/python2.6/site-packages/teamcalendar-0.1-py2.6.egg
TracPrivateTickets 	2.0.3 	/usr/lib/python2.6/site-packages/TracPrivateTickets-2.0.3-py2.6.egg
TracTicketDelete 	2.0.1 	/usr/lib/python2.6/site-packages/TracTicketDelete-2.0.1-py2.6.egg

Attachments

Change History

03/16/12 04:52:37 changed by rjollos

  • description changed.

03/26/12 21:42:00 changed by ChrisNelson

(In [11434]) Add setup configuration to tag build with SVN version. Refs #9908.

03/26/12 21:43:16 changed by ChrisNelson

  • status changed from new to assigned.

I don't have an 0.12 Trac installation to test in (though I may set one up soon). Please try this with the current code just to be sure it's still there.

03/28/12 19:03:34 changed by gmanukya@jpl.nasa.gov

Hi Chris,

thank you for getting back to me. I have tried as you have suggested but still getting:

Oops…
Trac detected an internal error:

OperationalError: near ",": syntax error
Python Traceback
Most recent call last:

    File "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/web/main.py", line 511, in _dispatch_request
    File "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/web/main.py", line 237, in dispatch
    File "/usr/lib/python2.6/site-packages/teamcalendar-0.1-py2.6.egg/teamcalendar/calendar.py", line 246, in process_request
    File "/usr/lib/python2.6/site-packages/teamcalendar-0.1-py2.6.egg/teamcalendar/calendar.py", line 168, in update_timetable
    File "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/db/util.py", line 65, in execute
    File "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/db/sqlite_backend.py", line 78, in execute
    File "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/db/sqlite_backend.py", line 56, in execute
    File "/usr/lib/python2.6/site-packages/Trac-0.12.2-py2.6.egg/trac/db/sqlite_backend.py", line 48, in _rollback_on_error 

03/28/12 19:12:10 changed by ChrisNelson

That section of code was changes recently in an attempt to be DB-agnostic:

            valuesClause = ','.join(('(%s,%s,%s)',) * len(inserts))
            # FIXME - we likely want to do this earlier on all of tuples.
            inserts = [(t[0], t[1], t[2] and 1 or 0) for t in inserts]
            # Quickly flatten the list.  List comprehension is always
            # weird.  See http://stackoverflow.com/questions/952914
            flat = [item for sublist in inserts for item in sublist]
            insert_cursor.execute("INSERT INTO %s " % self.table_name + \
                                      "(ondate, username, availability) " + \
                                      "VALUES %s" % valuesClause,
                                  flat)

It appears to be choking on the ',' after valuesClause. But I don't know why. Perhaps it's a difference between the 0.11 DBAPI here and 0.12 you are using.

07/22/12 01:07:37 changed by Miller

Kindly I'm getting the exact same errors as mentioned above with Trac 0.12.3, any update on this will be most appreciated. Thank you, Miller

10/31/12 21:00:04 changed by anonymous

Issue occurs for me as well on Trac 0.11.7, Python 2.5.2 and sqlite.

11/01/12 13:08:19 changed by ChrisNelson

(In [12272]) Try to address syntax error. Refs #9908.

There really doesn't seem to be anything wrong with the original but this might make a difference.


Add/Change #9908 (TeamCalendarPlugin works partially)




Change Properties
Action