Error messages could have incomplete unicode characters

Bug #499814 reported by Geert JM Vanderkelen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Connector/Python
Fix Released
Medium
Geert JM Vanderkelen

Bug Description

The error message returned by MySQL could include incomplete unicode characters. This results in an InterfaceError when handling the error.

    "Failed executing the operation; %s" % e)
mysql.connector.errors.InterfaceError: Failed executing the operation; 'utf8' codec can't decode bytes in position 213-215: invalid data

Fix is to 'ignore' the incomplete characters:

 self.errmsg = buf.decode('utf-8','ignore')

Tags: charset

Related branches

Revision history for this message
Geert JM Vanderkelen (geertjmvdk) wrote :

revno: 172
committer: Geert Vanderkelen <email address hidden>
branch nick: myconnpy-CHARSET
timestamp: Wed 2009-12-23 14:38:43 +0100
message:
  Fix for broken unicode characters when MySQL trimed the errmsg

  * On a syntax error, for example, the error message is trimmed by the
    MySQL server to a certain ammout of bytes. This can lead in broken
    unicode characters. We fix it by ignoring the characters, as they
    are seldom (read never) needed.
  * Added test case for bug lp:499814

Changed in myconnpy:
status: Confirmed → Fix Committed
Changed in myconnpy:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.