Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#221 conversion to unicode fails

closed-duplicate
nobody
MySQL (29)
5
2007-05-03
2007-05-03
Anonymous
No

Using SQLObject 0.8.2-1 (on Debian unstable)-
In _executeRetry in mysqlconnection.py there is an attempt to convert to unicode that does not first check if the query contains unicode already. The conversion fails (python cannot decode unicode). The following lines:

if self.need_unicode:
# For MysqlDB 1.2.1 and later, we go
# encoding->unicode->charset (in the mysql db)
myquery = unicode(query, self.encoding)
return cursor.execute(myquery)

should be changed so that the conditional is something like:
if self.need_unicode and not isinstance(query, unicode):

The error can be replicated by using:
someobject.selectBy(somecolumn = u'someid')

submitted by mullerb@musc.edu

Discussion

  • Oleg Broytman
    Oleg Broytman
    2007-05-03

    • status: open --> closed-duplicate