Opened 15 years ago
Last modified 4 years ago
#5627 new defect
TicketModifiedFiles 1.00: a single quote in an modified SVN file name causes an error — at Initial Version
Reported by: | Owned by: | Emilien Klein | |
---|---|---|---|
Priority: | high | Component: | TicketModifiedFilesPlugin |
Severity: | blocker | Keywords: | patch modified files OperationalError quote |
Cc: | richard.lyders@… | Trac Release: | 0.11 |
Description
TicketModifiedFiles 1.00 reports error [OperationalError: near "s": syntax error] when one of modified SVN files for a ticket has name that contains a single quote [eg, "today's"]
The file name in SVN can be deleted/renamed, but the error still occurs since TicketModifiedFiles still encounters the old file name and thus still errors out. I don't know how to work around this. I simply have to turn off modified files, but I love this plugin, so I hope it gets fixed soon!
I'm not very familiar with Python. I'll see about fixing it myself as I have time to dig into it.
ERROR STACK:
Oops… Trac detected an internal error:
OperationalError: near "s": syntax error
If you think this should work you can reproduce the problem, you should consider reporting this to the Trac team.
Before you do that, though, please first try searching for similar issues, as it is quite likely that this problem has been reported before. For questions about installation and configuration of Trac, please try the mailing list instead of filing a ticket.
Trac | 0.12dev-r7454 | Python | 2.5.1 (r251, Feb 13 2008, 06:34:30) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] | setuptools | 0.6c9 | SQLite | 3.5.1 | pysqlite | 2.3.5 | Genshi | 0.5.1 | mod_python | 3.3.1 | Pygments | 1.0 | Subversion | 1.4.6 (r28521) | jQuery: | 1.2.6 | ==== Python Traceback ==== Traceback (most recent call last): File "/home/rlyders/trac/python/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/web/main.py", line 447, in _dispatch_request dispatcher.dispatch(req) File "/home/rlyders/trac/python/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/web/main.py", line 229, in dispatch content_type) File "/home/rlyders/trac/python/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/web/chrome.py", line 703, in render_template stream |= self._filter_stream(req, method, filename, stream, data) File "/home/rlyders/trac/python/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/core.py", line 128, in __or__ return Stream(_ensure(function(self)), serializer=self.serializer) File "/home/rlyders/trac/python/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/web/chrome.py", line 790, in inner data) File "/home/rlyders/trac/python/lib/python2.5/site-packages/TicketModifiedFiles-1.00-py2.5.egg/ticketmodifiedfiles/ticketmodifiedfiles.py", line 72, in filter_stream numconflictingtickets = self.__process_ticket_request(req, True) File "/home/rlyders/trac/python/lib/python2.5/site-packages/TicketModifiedFiles-1.00-py2.5.egg/ticketmodifiedfiles/ticketmodifiedfiles.py", line 153, in __process_ticket_request cursor.execute("SELECT message FROM revision WHERE rev IN (SELECT rev FROM node_change WHERE path='%s')" % file) File "/home/rlyders/trac/python/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/db/util.py", line 51, in execute return self.cursor.execute(sql) File "/home/rlyders/trac/python/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/db/sqlite_backend.py", line 59, in execute args or []) File "/home/rlyders/trac/python/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/db/sqlite_backend.py", line 51, in _rollback_on_error return function(self, *args, **kwargs) OperationalError: near "s": syntax error a new ticket at the Trac project site, where you can describe the problem and explain how to reproduce it.
|
Python Traceback Most recent call last:
- File "/home/rlyders/trac/python/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/web/main.py", line 447, in _dispatch_request
Code fragment:
- try:
- if not env and env_error:
- raise HTTPInternalError(env_error)
- try:
- dispatcher = RequestDispatcher(env)
- dispatcher.dispatch(req)
- except RequestDone:
- pass
- resp = req._response or []
- except HTTPException, e:
- File "/home/rlyders/trac/python/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/web/main.py", line 229, in dispatch
Code fragment:
- pprint(data, out)
- req.send(out.getvalue(), 'text/plain')
- else:
- output = chrome.render_template(req, template,
- data,
- content_type)
- # Give the session a chance to persist changes
- if req.session:
- req.session.save()
- req.send(output, content_type or 'text/html')
- File "/home/rlyders/trac/python/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/web/chrome.py", line 703, in render_template
Code fragment:
- stream = template.generate(data)
- # Filter through ITemplateStreamFilter plugins
- if self.stream_filters:
- stream |= self._filter_stream(req, method, filename, stream, data)
- if fragment:
- return stream
- if method == 'text':
- File "/home/rlyders/trac/python/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/core.py", line 128, in or Local variables: Name Value function <function inner at 0x7f557d4> self <genshi.core.Stream object at 0x3ba120c>
- File "/home/rlyders/trac/python/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/web/chrome.py", line 790, in inner
Code fragment:
- def _filter_stream(self, req, method, filename, stream, data):
- def inner(stream, ctxt=None):
- for filter in self.stream_filters:
- stream = filter.filter_stream(req, method, filename, stream,
- data)
- return stream
- return inner
- File "/home/rlyders/trac/python/lib/python2.5/site-packages/TicketModifiedFiles-1.00-py2.5.egg/ticketmodifiedfiles/ticketmodifiedfiles.py", line 72, in filter_stream Local variables: Name Value data {'abs_url_of': <function get_abs_url at 0x7f551ec>, 'comment': None, ... filename 'ticket.html' method 'xhtml' req <Request "GET u'/ticket/1351'"> self <ticketmodifiedfiles.ticketmodifiedfiles.TicketModifiedFilesPlugin object ... stream <genshi.core.Stream object at 0x7f5a32c>
- File "/home/rlyders/trac/python/lib/python2.5/site-packages/TicketModifiedFiles-1.00-py2.5.egg/ticketmodifiedfiles/ticketmodifiedfiles.py", line 153, in process_ticket_request Local variables: Name Value author u'richard.lyders' cursor <trac.db.util.IterableCursor object at 0x5e318cc> db <trac.db.pool.PooledConnection object at 0x7f5a9ac> file u"corisplus/branches/richard.lyders/trac/1351/Today's testing call.msg" files [u'corisplus/branches/richard.lyders/trac/1351', ... filestatus {} id 1351 ignored_statuses [u'closed'] justnumconflictingtickets True match <_sre.SRE_Match object at 0x7f66660> message u'#1351 moved files from #1319' node_change (u'corisplus/branches/richard.lyders/trac/1351/Todays testing call.msg', ... repos <trac.versioncontrol.cache.CachedRepository object at 0x31e4ccc> req <Request "GET u'/ticket/1351'"> rev u'3691' revisions [] self <ticketmodifiedfiles.ticketmodifiedfiles.TicketModifiedFilesPlugin object ... tempstr [u, u' remove quote'] tempticketslist [] thisticket <trac.ticket.model.Ticket object at 0x7f5a82c> ticket 1351 ticketsperfile {u'corisplus/branches/richard.lyders/trac/1351': []} time 1249506746 validrevision True
- File "/home/rlyders/trac/python/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/db/util.py", line 51, in execute
Code fragment:
- # -- In case of SQL errors, uncomment the following 'print' statements
- # print 'execute', repr(sql)
- if args:
- # print repr(args)
- return self.cursor.execute(sql_escape_percent(sql), args)
- return self.cursor.execute(sql)
- def executemany(self, sql, args=None):
- # print 'executemany', repr(sql)
- if args:
- # print repr(args)
- File "/home/rlyders/trac/python/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/db/sqlite_backend.py", line 59, in execute
Code fragment:
- raise
- def execute(self, sql, args=None):
- if args:
- sql = sql % (('?',) * len(args))
- return self._rollback_on_error(sqlite.Cursor.execute, sql,
- args or [])
- def executemany(self, sql, args=None):
- if args:
- sql = sql % (('?',) * len(args[0]))
- return self._rollback_on_error(sqlite.Cursor.executemany, sql,
- args or [])
- File "/home/rlyders/trac/python/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/db/sqlite_backend.py", line 51, in _rollback_on_error
Code fragment:
- sqlite_version_string = '%d.%d.%d' % (_ver[0], _ver[1], int(_ver[2]))
- class PyFormatCursor(sqlite.Cursor):
- def _rollback_on_error(self, function, *args, kwargs):
- try:
- return function(self, *args, kwargs)
- except sqlite.DatabaseError, e:
- self.cnx.rollback()
- raise
- def execute(self, sql, args=None):
- if args:
File "/home/rlyders/trac/python/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/web/main.py", line 447, in _dispatch_request
dispatcher.dispatch(req)
File "/home/rlyders/trac/python/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/web/main.py", line 229, in dispatch
content_type)
File "/home/rlyders/trac/python/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/web/chrome.py", line 703, in render_template
stream |= self._filter_stream(req, method, filename, stream, data)
File "/home/rlyders/trac/python/lib/python2.5/site-packages/Genshi-0.5.1-py2.5-linux-i686.egg/genshi/core.py", line 128, in orFile "/home/rlyders/trac/python/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/web/chrome.py", line 790, in inner
data)
File "/home/rlyders/trac/python/lib/python2.5/site-packages/TicketModifiedFiles-1.00-py2.5.egg/ticketmodifiedfiles/ticketmodifiedfiles.py", line 72, in filter_streamFile "/home/rlyders/trac/python/lib/python2.5/site-packages/TicketModifiedFiles-1.00-py2.5.egg/ticketmodifiedfiles/ticketmodifiedfiles.py", line 153, in process_ticket_requestFile "/home/rlyders/trac/python/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/db/util.py", line 51, in execute
return self.cursor.execute(sql)
File "/home/rlyders/trac/python/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/db/sqlite_backend.py", line 59, in execute
args or [])
File "/home/rlyders/trac/python/lib/python2.5/site-packages/Trac-0.12dev_r7454-py2.5.egg/trac/db/sqlite_backend.py", line 51, in _rollback_on_error
return function(self, *args, kwargs)
System Information:
User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.13) Gecko/2009073022 Firefox/3.0.13 (.NET CLR 3.5.30729) Trac: 0.12dev-r7454 Python: 2.5.1 (r251, Feb 13 2008, 06:34:30) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] setuptools: 0.6c9 SQLite: 3.5.1 pysqlite: 2.3.5 Genshi: 0.5.1 mod_python: 3.3.1 Pygments: 1.0 Subversion: 1.4.6 (r28521) jQuery: 1.2.6
TracGuide — The Trac User and Administration Guide