Modify ↓
Opened 16 years ago
Closed 16 years ago
#8025 closed defect (wontfix)
OperationalError: syntax error due to an [ ' ] in milestone title
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | roadmap | Version: | 0.11-stable |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
Trac detected an internal error: OperationalError: near "installation": syntax error
in this case, the dev team has put in an [ ' ] on a milestone title, such as:
procédure d'installation
the [ ' ] caractere caused errors on roadmap and iteration plugin. removing that [ ' ], is a solution. but, in some langages, [ ' ] is present, which could be a problem.
here's some logs:
Most recent call last:
* File "/usr/local/lib/python2.5/site-packages/Trac-0.11stable_r7810-py2.5.egg/trac/web/main.py", line 423, in _dispatch_request Code fragment: 418. try: 419. if not env and env_error: 420. raise HTTPInternalError(env_error) 421. try: 422. dispatcher = RequestDispatcher(env) 423. dispatcher.dispatch(req) 424. except RequestDone: 425. pass 426. resp = req._response or [] 427. 428. except HTTPException, e: Local variables: Name Value after [u' except RequestDone:', u' pass', u' resp = ... before [u' try:', u' if not env and env_error:', u' raise ... dispatcher <trac.web.main.RequestDispatcher object at 0x2908872c> e OperationalError('near "Decoupage": syntax error',) env <trac.env.Environment object at 0x28ca3ccc> env_error None exc_info (<class 'pysqlite2.dbapi2.OperationalError'>, OperationalError('near ... filename '/usr/local/lib/python2.5/site-packages/Trac-0.11stable_r7810-py2.5.egg/tra ... frames [{'function': '_dispatch_request', 'lines_before': [u' try:', u' ... has_admin True line u' dispatcher.dispatch(req)' lineno 422 message u'OperationalError: near "Decoupage": syntax error' req <Request "GET u'/iteration'"> resp [] tb <traceback object at 0x29506f7c> tb_hide None traceback 'Traceback (most recent call last):\n File ... * File "/usr/local/lib/python2.5/site-packages/Trac-0.11stable_r7810-py2.5.egg/trac/web/main.py", line 197, in dispatch Code fragment: 192. req.args.get('__FORM_TOKEN') != req.form_token: 193. raise HTTPBadRequest('Missing or invalid form token. ' 194. 'Do you have cookies enabled?') 195. 196. # Process the request and render the template 197. resp = chosen_handler.process_request(req) 198. if resp: 199. if len(resp) == 2: # Clearsilver 200. chrome.populate_hdf(req) 201. template, content_type = \ 202. self._post_process_request(req, *resp) Local variables: Name Value chosen_handler <trac.ticket.roadmap.IterationModule object at 0x2908f66c> chrome <trac.web.chrome.Chrome object at 0x28c48dac> err (<class 'pysqlite2.dbapi2.OperationalError'>, OperationalError('near ... handler <trac.ticket.roadmap.IterationModule object at 0x2908f66c> req <Request "GET u'/iteration'"> self <trac.web.main.RequestDispatcher object at 0x2908872c> * File "/usr/local/lib/python2.5/site-packages/Trac-0.11stable_r7810-py2.5.egg/trac/ticket/roadmap.py", line 479, in process_request Code fragment: 474. elif action == 'edit': 475. return self._do_save(req, db, iteration) 476. elif action == 'delete': 477. self._do_delete(req, db, iteration) 478. elif action in ('new', 'edit'): 479. return self._render_editor(req, db, iteration) 480. elif action == 'delete': 481. return self._render_confirm(req, db, iteration) 482. 483. if not iteration.id: 484. req.redirect(req.href.iterations()) Local variables: Name Value action u'new' db <trac.db.pool.PooledConnection object at 0x2950f20c> iteration <trac.ticket.model.Iteration object at 0x2950f22c> iteration_id None req <Request "GET u'/iteration'"> self <trac.ticket.roadmap.IterationModule object at 0x2908f66c> * File "/usr/local/lib/python2.5/site-packages/Trac-0.11stable_r7810-py2.5.egg/trac/ticket/roadmap.py", line 567, in _render_editor Code fragment: 562. 'iterations': Iteration.select(self.env, False, db) 563. } 564. return 'iteration_delete.html', data, None 565. 566. def _render_editor(self, req, db, iteration): 567. iteration_info = TicketSystem(self.env).get_iteration_info(iteration, req, self.stats_provider) 568. ticket_fields = TicketSystem(self.env).get_ticket_fields() 569. completion_stages = TicketSystem(self.env).get_completion_stages() 570. 571. data = { 572. 'iteration': iteration, Local variables: Name Value db <trac.db.pool.PooledConnection object at 0x2950f20c> iteration <trac.ticket.model.Iteration object at 0x2950f22c> req <Request "GET u'/iteration'"> self <trac.ticket.roadmap.IterationModule object at 0x2908f66c> * File "/usr/local/lib/python2.5/site-packages/Trac-0.11stable_r7810-py2.5.egg/trac/ticket/api.py", line 605, in get_iteration_info Code fragment: 600. 601. tickets = self.get_tickets_for_iteration(db, iteration.tickets) 602. tickets = self.apply_ticket_permissions(req, tickets) 603. 604. milestones = self.get_milestones_for_tickets(tickets) 605. milestone_sizing_stats = self.get_sizing_statistics_for_milestones(milestones) 606. 607. end_date = date.today() 608. if iteration.end_date: 609. end_date = iteration.end_date.date() 610. Local variables: Name Value db <trac.db.pool.PooledConnection object at 0x2950f2ec> iteration <trac.ticket.model.Iteration object at 0x2950f22c> milestones set([]) req <Request "GET u'/iteration'"> self <trac.ticket.api.TicketSystem object at 0x2908f48c> stats_provider <trac.ticket.roadmap.DefaultTicketGroupStatsProvider object at 0x2950f3cc> tickets [] * File "/usr/local/lib/python2.5/site-packages/Trac-0.11stable_r7810-py2.5.egg/trac/ticket/api.py", line 415, in get_sizing_statistics_for_milestones Code fragment: 410. else: 411. sizing_stats[stage_name]['average_defined_size'] = sizing_stats['average_defined_size'] 412. 413. if sizing_stats['average_defined_size'] == 0: 414. cursor.execute("SELECT tc.ticket,tc.stage,tc.size FROM ticket_completion tc, ticket t WHERE tc.ticket = t.id AND t.milestone IN (\'%s\')" % 415. "\',\'".join(remaining_milestones)) 416. 417. for ticket, stage, size in cursor: 418. integer_size = 0 419. size_defined = True 420. try: Local variables: Name Value Milestone <class 'trac.ticket.model.Milestone'> cursor <trac.db.util.IterableCursor object at 0x2944c674> m <trac.ticket.model.Milestone object at 0x2950f5cc> milestones_names set([]) remaining_milestones [u"Ancien Projet v01 '", u'Decoupage', u'Iterations', u'M00 : ... self <trac.ticket.api.TicketSystem object at 0x2908f48c> sizing_stats {'acceptance_complete': {'min_size': 0, 'average_defined_size': 0, ... stage {'order': 3, 'name': 'acceptance_complete', 'short_label': u'Acceptance', ... stage_name 'acceptance_complete' stages [{'order': 1, 'name': 'test_complete', 'short_label': u'Tested', 'label': ... * File "/usr/local/lib/python2.5/site-packages/Trac-0.11stable_r7810-py2.5.egg/trac/db/util.py", line 51, in execute Code fragment: 46. # -- In case of SQL errors, uncomment the following 'print' statements 47. # print 'execute', repr(sql) 48. if args: 49. # print repr(args) 50. return self.cursor.execute(sql_escape_percent(sql), args) 51. return self.cursor.execute(sql) 52. 53. def executemany(self, sql, args=None): 54. # print 'executemany', repr(sql) 55. if args: 56. # print repr(args) Local variables: Name Value args None self <trac.db.util.IterableCursor object at 0x2944c674> sql u"SELECT tc.ticket,tc.stage,tc.size FROM ticket_completion tc, ticket t ... * File "/usr/local/lib/python2.5/site-packages/Trac-0.11stable_r7810-py2.5.egg/trac/db/sqlite_backend.py", line 58, in execute Code fragment: 53. raise 54. def execute(self, sql, args=None): 55. if args: 56. sql = sql % (('?',) * len(args)) 57. return self._rollback_on_error(sqlite.Cursor.execute, sql, 58. args or []) 59. def executemany(self, sql, args=None): 60. if args: 61. sql = sql % (('?',) * len(args[0])) 62. return self._rollback_on_error(sqlite.Cursor.executemany, sql, 63. args or []) Local variables: Name Value args None self <trac.db.sqlite_backend.PyFormatCursor object at 0x2957da6c> sql u"SELECT tc.ticket,tc.stage,tc.size FROM ticket_completion tc, ticket t ... * File "/usr/local/lib/python2.5/site-packages/Trac-0.11stable_r7810-py2.5.egg/trac/db/sqlite_backend.py", line 50, in _rollback_on_error Code fragment: 45. sqlite_version_string = '%d.%d.%d' % (_ver[0], _ver[1], int(_ver[2])) 46. 47. class PyFormatCursor(sqlite.Cursor): 48. def _rollback_on_error(self, function, *args, **kwargs): 49. try: 50. return function(self, *args, **kwargs) 51. except sqlite.DatabaseError, e: 52. self.cnx.rollback() 53. raise 54. def execute(self, sql, args=None): 55. if args: Local variables: Name Value args (u"SELECT tc.ticket,tc.stage,tc.size FROM ticket_completion tc, ticket t ... e OperationalError('near "Decoupage": syntax error',) function <method 'execute' of 'pysqlite2.dbapi2.Cursor' objects> kwargs {} self <trac.db.sqlite_backend.PyFormatCursor object at 0x2957da6c> File "/usr/local/lib/python2.5/site-packages/Trac-0.11stable_r7810-py2.5.egg/trac/web/main.py", line 423, in _dispatch_request dispatcher.dispatch(req) File "/usr/local/lib/python2.5/site-packages/Trac-0.11stable_r7810-py2.5.egg/trac/web/main.py", line 197, in dispatch resp = chosen_handler.process_request(req) File "/usr/local/lib/python2.5/site-packages/Trac-0.11stable_r7810-py2.5.egg/trac/ticket/roadmap.py", line 479, in process_request return self._render_editor(req, db, iteration) File "/usr/local/lib/python2.5/site-packages/Trac-0.11stable_r7810-py2.5.egg/trac/ticket/roadmap.py", line 567, in _render_editor iteration_info = TicketSystem(self.env).get_iteration_info(iteration, req, self.stats_provider) File "/usr/local/lib/python2.5/site-packages/Trac-0.11stable_r7810-py2.5.egg/trac/ticket/api.py", line 605, in get_iteration_info milestone_sizing_stats = self.get_sizing_statistics_for_milestones(milestones) File "/usr/local/lib/python2.5/site-packages/Trac-0.11stable_r7810-py2.5.egg/trac/ticket/api.py", line 415, in get_sizing_statistics_for_milestones "\',\'".join(remaining_milestones)) File "/usr/local/lib/python2.5/site-packages/Trac-0.11stable_r7810-py2.5.egg/trac/db/util.py", line 51, in execute return self.cursor.execute(sql) File "/usr/local/lib/python2.5/site-packages/Trac-0.11stable_r7810-py2.5.egg/trac/db/sqlite_backend.py", line 58, in execute args or []) File "/usr/local/lib/python2.5/site-packages/Trac-0.11stable_r7810-py2.5.egg/trac/db/sqlite_backend.py", line 50, in _rollback_on_error return function(self, *args, **kwargs)
Attachments (0)
Change History (1)
comment:1 by , 16 years ago
Description: | modified (diff) |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
I saw you already reported this on the Trac-users mailing list. I think you actually wanted to report this on the DevjaVu Trac (http://agiletrac.devjavu.com/), since we don't maintain the AgileTrac plugin here.
Milestone names such as "procédure d'installation" work fine with the "base" Trac.