#63 Crach wen warning after execute

open
MySQLdb (53)
5
2012-09-19
2009-11-12
No

Windows Vista Home Basic Ru + sp2
Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] on win32
MySQLdb svn rev 633 (self build from mingw32 gcc 4.4.0)

Sample code to reproduce:

-*- coding: utf-8

from MySQLdb import connect
conn = connect(...)
curs = conn.cursor()
curs.execute('drop table if exists notExistTable')

Console session:
F:\Lang\sf.net\svn\MySQLdb>warning_test.py
Traceback (most recent call last):
File "F:\Lang\sf.net\svn\MySQLdb\warning_test.py", line 5, in <module>
curs.execute('drop table if exists notExistTable')
File "F:\Lang\sf.net\svn\MySQLdb\MySQLdb\cursors.py", line 184, in execute
self._warning_check()
File "F:\Lang\sf.net\svn\MySQLdb\MySQLdb\cursors.py", line 90, in _warning_check
warnings = self._get_db()._show_warnings()
AttributeError: _show_warnings

Simple correct line
warnings = self._get_db()._show_warnings()
to
warnings = self.connection._show_warnings()

Discussion

  • Alexandr Zamaraev (aka Tonal)

    Your patch will not be applied.

     

Log in to post a comment.