We help IT Professionals succeed at work.

cursor error in python

LuckyLucks used Ask the Experts™

I sometimes get this kind of cursor error that magically goes away at a later time without any modification to the code.
 File "/usr/local/src/python/myscript.py", line 134, in ?
  File "/usr/lib/python2.4/site-packages/MySQLdb/cursors.py", line 137, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib/python2.4/site-packages/MySQLdb/connections.py", line 33, in defaulterrorhandler
    raise errorclass, errorvalue
_mysql_exceptions.ProgrammingError: cursor closed

this leads me to think that somewhere either a table is corrupted or the mysql server is busy.

does anyone know what this indicates really?

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2011
probably a connection timeout?

you need to check the mysql logs to try and see what errors are present...

unless you have a code glitch, and haven't properly opened the cursor in the first place....

do you have transactions? have you "commited and closed the cursor?"

which version of mysql?
can you show your code..?