Closed
Description
mysqlclient==1.3.6
In the following script, cursor.execute() is called on a closed cursor. The results is "TypeError: 'NoneType' object is not callable" but one expects a ProgrammingError
. It looks as though errorhandler
is assigned to None
when closed in BaseCursor.close()
. Full output below:
import MySQLdb
conn = MySQLdb.connect(user='root', db='mytest')
with conn.cursor() as cursor:
cursor.execute('select 1')
cursor.execute('select 1')
$ venv/bin/python test.py
Traceback (most recent call last):
File "test.py", line 6, in <module>
cursor.execute('select 1')
File "/home/jon/venv/lib/python2.7/site-packages/MySQLdb/cursors.py", line 181, in execute
while self.nextset():
File "/home/jon/venv/lib/python2.7/site-packages/MySQLdb/cursors.py", line 133, in nextset
db = self._get_db()
File "/home/jon/venv/lib/python2.7/site-packages/MySQLdb/cursors.py", line 166, in _get_db
self.errorhandler(self, ProgrammingError, "cursor closed")
TypeError: 'NoneType' object is not callable
Metadata
Metadata
Assignees
Labels
No labels