Menu

Warning bug

dzn
2006-10-03
2012-09-19
  • dzn

    dzn - 2006-10-03

    My system:
    win2ksp6
    Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32
    1.2.1_p2

    When mysqldb wants to show warning exception raising instead.

    Traceback (most recent call last):
    File "test.py", line 8, in ?
    db.execute('DROP TABLE IF EXISTS asdfasdfasdfasdf')
    File "C:\sbin\Python24\lib\site-packages\MySQLdb\cursors.py", line 166, in execute
    self._warning_check()
    File "C:\sbin\Python24\lib\site-packages\MySQLdb\cursors.py", line 81, in _warning_check
    warn(w[-1], self.Warning, 3)
    File "C:\sbin\Python24\lib\warnings.py", line 57, in warn
    warn_explicit(message, category, filename, lineno, module, registry)
    File "C:\sbin\Python24\lib\warnings.py", line 75, in warn_explicit
    if registry.get(key):
    TypeError: unhashable type

    I changed one line in cursors.py and it solved a problem.

    Was: warn(w[-1], self.Warning, 3)
    Become: warn(w[-1].tostring(), self.Warning, 3)

     
    • Andy Dustman

      Andy Dustman - 2006-10-03

      What was the original type? array? This is fixed in 1.2.2b1, please test. This was due to binary collations being converted to arrays; they are now returned as strings.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.