Modify ↓
#6341 closed defect (fixed)
Cannot operate on a closed cursor error
Reported by: | lkraav | Owned by: | lkraav |
---|---|---|---|
Priority: | normal | Component: | TracPastePlugin |
Severity: | normal | Keywords: | ProgrammingError, closed, cursor |
Cc: | Michael Renzmann | Trac Release: | 0.11 |
Description (last modified by )
2009-12-16 14:26:35,474 Trac[chrome] DEBUG: Prepare chrome data for request 2009-12-16 14:26:35,478 Trac[model] DEBUG: get_pastes() SQL: 'SELECT id, title, author, time FROM pastes ORDER BY id DESC LIMIT 10' (None) 2009-12-16 14:26:35,599 Trac[main] ERROR: Internal Server Error: Traceback (most recent call last): File "/secure/trac/virtual-0.11/trac-src/trac/web/main.py", line 450, in _dispatch_request dispatcher.dispatch(req) File "/secure/trac/virtual-0.11/trac-src/trac/web/main.py", line 206, in dispatch resp = chosen_handler.process_request(req) File "build/bdist.linux-i686/egg/tracpaste/web_ui.py", line 141, in process_request 'recent': get_pastes(env=self.env, number=self.max_recent) File "build/bdist.linux-i686/egg/tracpaste/model.py", line 53, in get_pastes cursor.execute(sql, where_values) File "/secure/trac/virtual-0.11/trac-src/trac/db/util.py", line 65, in execute return self.cursor.execute(sql) File "/secure/trac/virtual-0.11/trac-src/trac/db/sqlite_backend.py", line 80, in execute PyFormatCursor.execute(self, *args) File "/secure/trac/virtual-0.11/trac-src/trac/db/sqlite_backend.py", line 59, in execute args or []) File "/secure/trac/virtual-0.11/trac-src/trac/db/sqlite_backend.py", line 51, in _rollback_on_error return function(self, *args, **kwargs) ProgrammingError: Cannot operate on a closed cursor.
Attachments (0)
Change History (9)
comment:1 Changed 15 years ago by
comment:2 Changed 14 years ago by
Description: | modified (diff) |
---|---|
Summary: | TracPastePlugin: 0.11.6 - Cannot operate on a closed cursor error → Cannot operate on a closed cursor error |
#7138 was closed as a duplicate.
comment:3 Changed 14 years ago by
Cc: | Michael Renzmann added; anonymous removed |
---|
Isn't this (source:tracpasteplugin/0.11/tracpaste/model.py@4949#L31)
cursor = (db or env.get_db_cnx()).cursor()
just as bad of a practice as?:
cursor = env.get_db_cnx().cursor
Shouldn't we replace that code with?:
db = (db or env.get_db_cnx()) cursor = db.cursor()
comment:4 Changed 14 years ago by
Since I have TracPastePlugin setup in a dev environment following #8298, I'd be happy to apply the proposed fix for this as well, given permission of the maintainer.
-
0.11/tracpaste/model.py
28 28 29 29 To get the paste data, use id to instantiate a Paste object.""" 30 30 31 cursor = (db or env.get_db_cnx()).cursor() 31 db = db or env.get_db_cnx() 32 cursor = db.cursor() 32 33 33 34 sql = "SELECT id, title, author, time FROM pastes" 34 35 order_clause = " ORDER BY id DESC"
comment:8 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:9 Changed 11 years ago by
Keywords: | ProgrammingError closed cursor added |
---|
Note: See
TracTickets for help on using
tickets.
this could be related to #6302.