id	summary	reporter	owner	description	type	status	priority	component	severity	resolution	keywords	cc	release
6765	Hackergotchi doesn't work with trac 0.11.6	Jens.Langner@light-speed.de	rjollos	After trying to install the HackergotchiPlugin in a trac 0.11.6 installation I get the following error:\r\n\r\n{{{\r\nProgrammingError: Cannot operate on a closed cursor.\r\n}}}\r\n\r\nAfter some investigation and help from #trac I found the following code in Hackergotchi to be responsible for the error. Here is a patch for it:\r\n\r\n{{{\r\nIndex: hackergotchi/web_ui.py\r\n===================================================================\r\n--- hackergotchi/web_ui.py_(revision 7751)\r\n+++ hackergotchi/web_ui.py_(working copy)\r\n@@ -29,8 +29,6 @@\r\n     def filter_stream(self, req, method, filename, stream, data):\r\n         if req.path_info.startswith('/timeline'):\r\n             closure_state = [0]\r\n-            db = self.env.get_db_cnx()\r\n-            cursor = db.cursor()\r\n             cache = {}\r\n             def f(stream):\r\n                 # Update the closed value\r\n@@ -43,6 +41,8 @@\r\n                 if user_info is not None:\r\n                     author, name, email = user_info\r\n                 else:\r\n+                    db = self.env.get_db_cnx()\r\n+                    cursor = db.cursor()\r\n                     user_info = self._get_info(author, cursor)\r\n                     cache[author] = user_info\r\n                     author, name, email = user_info\r\n}}}\r\n\r\nAfter applying that patch the error disappeared.	defect	closed	normal	HackergotchiPlugin	critical	fixed	database cursor scope	hasienda	0.11
