After trying to install the HackergotchiPlugin in a trac 0.11.6 installation I get the following error:
ProgrammingError: Cannot operate on a closed cursor.
After 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:
Index: hackergotchi/web_ui.py
===================================================================
--- hackergotchi/web_ui.py (revision 7751)
+++ hackergotchi/web_ui.py (working copy)
@@ -29,8 +29,6 @@
def filter_stream(self, req, method, filename, stream, data):
if req.path_info.startswith('/timeline'):
closure_state = [0]
- db = self.env.get_db_cnx()
- cursor = db.cursor()
cache = {}
def f(stream):
# Update the closed value
@@ -43,6 +41,8 @@
if user_info is not None:
author, name, email = user_info
else:
+ db = self.env.get_db_cnx()
+ cursor = db.cursor()
user_info = self._get_info(author, cursor)
cache[author] = user_info
author, name, email = user_info
After applying that patch the error disappeared.