MySQLdb1 icon indicating copy to clipboard operation
MySQLdb1 copied to clipboard

i got a AttributeError

Open bells opened this issue 11 years ago • 2 comments

i use MySQLdb with DBUtils. dbutil.py:

g_dbpool = PooledDB(creator=MySQLdb, mincached=2, maxcached=40, host=config.DBHOST, port=config.DBPORT, user=config.DBUSER, passwd=config.DBPASSWORD, db=config.DBSCHEMA)

def execute(sql): conn = g_dbpool.connection() cur = conn.cursor() count = cur.execute(sql) conn.commit() cur.close() conn.close() return count

but i got below exception sometimes.

count = cur.execute(sql) File "/usr/local/lib/python2.7/site-packages/DBUtils-1.1-py2.7.egg/DBUtils/SteadyDB.py", line 552, in tough_method result = method(_args, *_kwargs) # try to execute File "build/bdist.linux-x86_64/egg/MySQLdb/cursors.py", line 176, in execute if not self._defer_warnings: self._warning_check() File "build/bdist.linux-x86_64/egg/MySQLdb/cursors.py", line 85, in _warning_check warnings = self._get_db().show_warnings() File "build/bdist.linux-x86_64/egg/MySQLdb/connections.py", line 319, in show_warnings warnings = r.fetch_row(0) AttributeError: 'NoneType' object has no attribute 'fetch_row'

bells avatar Jan 22 '14 14:01 bells

You haven't given me any version numbers.

farcepest avatar Jan 22 '14 17:01 farcepest

sorry! version info: DBUtils==1.1 MySQL-python==1.2.3

thank you!!

bells avatar Jan 23 '14 03:01 bells