Modify ↓
Opened 14 years ago
Closed 13 years ago
#8657 closed defect (fixed)
ProgrammingError: Cannot operate on a closed cursor
Reported by: | schodet | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Component: | ExtendedVersionPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
Seen on trac 0.11.7.
File "/usr/lib/python2.6/dist-packages/trac/web/main.py", line 450, in _dispatch_request dispatcher.dispatch(req) File "/usr/lib/python2.6/dist-packages/trac/web/main.py", line 227, in dispatch data, content_type) File "/usr/lib/python2.6/dist-packages/trac/web/chrome.py", line 773, in render_template stream.render(method, doctype=doctype, out=buffer) File "/usr/lib/pymodules/python2.6/genshi/core.py", line 183, in render return encode(generator, method=method, encoding=encoding, out=out) File "/usr/lib/pymodules/python2.6/genshi/output.py", line 58, in encode for chunk in iterator: File "/usr/lib/pymodules/python2.6/genshi/output.py", line 339, in __call__ for kind, data, pos in stream: File "/usr/lib/pymodules/python2.6/genshi/output.py", line 826, in __call__ for kind, data, pos in stream: File "/usr/lib/pymodules/python2.6/genshi/output.py", line 670, in __call__ for kind, data, pos in stream: File "/usr/lib/pymodules/python2.6/genshi/output.py", line 771, in __call__ for kind, data, pos in chain(stream, [(None, None, None)]): File "/usr/lib/pymodules/python2.6/genshi/output.py", line 586, in __call__ for ev in stream: File "/usr/lib/pymodules/python2.6/genshi/core.py", line 288, in _ensure for event in stream: File "/usr/lib/pymodules/python2.6/genshi/core.py", line 288, in _ensure for event in stream: File "/usr/lib/python2.6/dist-packages/trac/web/chrome.py", line 838, in _strip_accesskeys for kind, data, pos in stream: File "/usr/lib/pymodules/python2.6/genshi/core.py", line 288, in _ensure for event in stream: File "/usr/lib/python2.6/dist-packages/trac/web/chrome.py", line 827, in _generate for kind, data, pos in stream: File "/usr/lib/pymodules/python2.6/genshi/core.py", line 288, in _ensure for event in stream: File "/usr/lib/pymodules/python2.6/genshi/core.py", line 288, in _ensure for event in stream: File "/usr/lib/pymodules/python2.6/genshi/filters/transform.py", line 686, in _unmark for mark, event in stream: File "/usr/lib/pymodules/python2.6/genshi/filters/transform.py", line 1152, in __call__ for subevent in self._inject(): File "/usr/lib/pymodules/python2.6/genshi/filters/transform.py", line 1042, in _inject content = content() File "/usr/local/lib/python2.6/dist-packages/ExtendedVersionTracPlugin-0.0-py2.6.egg/extendedversion/milestone.py", line 83, in apply_version return self._version_display(req, buffer.events[1][1]) File "/usr/local/lib/python2.6/dist-packages/ExtendedVersionTracPlugin-0.0-py2.6.egg/extendedversion/milestone.py", line 90, in _version_display cursor.execute("SELECT version FROM milestone_version WHERE milestone=%s", (milestone,)) File "/usr/lib/python2.6/dist-packages/trac/db/util.py", line 64, in execute return self.cursor.execute(sql_escape_percent(sql), args) File "/usr/lib/python2.6/dist-packages/trac/db/sqlite_backend.py", line 80, in execute result = PyFormatCursor.execute(self, *args) File "/usr/lib/python2.6/dist-packages/trac/db/sqlite_backend.py", line 59, in execute args or []) File "/usr/lib/python2.6/dist-packages/trac/db/sqlite_backend.py", line 51, in _rollback_on_error return function(self, *args, **kwargs)
As a workaround, I temporarily disabled the _version_display function:
-
extendedversion/milestone.py
86 86 return stream | filter 87 87 88 88 def _version_display(self, req, milestone): 89 # XXX not working. 90 return [] 89 91 cursor = self.env.get_db_cnx().cursor() 90 92 cursor.execute("SELECT version FROM milestone_version WHERE milestone=%s", (milestone,)) 91 93 row = cursor.fetchone()
Attachments (0)
Change History (2)
comment:1 Changed 13 years ago by
Owner: | changed from Malcolm Studd to Ryan J Ollos |
---|---|
Status: | new → assigned |
comment:2 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note: See
TracTickets for help on using
tickets.
(In [11249]) Fixes #8657: Prevent database connection from being closed by keeping an explicit database object in scope.