Who is throwing (and catching) this MySQL Exception?
After printing out a bunch of stuff and debugging, I figured out the problem I think.  One of the libraries that I used didn't close the connection or the cursor.  But this problem only shows up if I iterate through a large amount of data.  The problem is also very intermittent and I still don't know who's throwing the "command out of sync" exception.  But now that we closed both the connection and cursor, I don't see the errors anymore.
i'm using Python with MySQL and Django.  I keep seeing this error and I can't figure out where the exception is being thrown:

Exception _mysql_exceptions.ProgrammingError: (2014, "Commands out of sync; you can't run this command now") in <bound method Cursor.__del__ of <MySQLdb.cursors.Cursor object at 0x20108150>> ignored

I have many "try" and "exception" blocks in my code--if the exception occurred within one of those, then I would see my own debugging messages.  The above Exception is obviously being caught somewhere since my program does not abort when the Exception is thrown.
I'm very puzzled, can someone help me out?