i got a AttributeError
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'
You haven't given me any version numbers.
sorry! version info: DBUtils==1.1 MySQL-python==1.2.3
thank you!!