Author: novalis
Date: 2007-09-25 20:52:25 -0600 (Tue, 25 Sep 2007)
New Revision: 2986
Modified:
SQLObject/trunk/sqlobject/mysql/mysqlconnection.py
Log:
make blobcols work with real binary data
Modified: SQLObject/trunk/sqlobject/mysql/mysqlconnection.py
===================================================================
--- SQLObject/trunk/sqlobject/mysql/mysqlconnection.py 2007-09-25 15:38:45 UTC (rev 2985)
+++ SQLObject/trunk/sqlobject/mysql/mysqlconnection.py 2007-09-26 02:52:25 UTC (rev 2986)
@@ -110,7 +110,10 @@
# For MySQLdb 1.2.1 and later, we go
# encoding->unicode->charset (in the mysql db)
if self.need_unicode and not isinstance(query, unicode):
- query = unicode(query, self.encoding)
+ try:
+ query = unicode(query, self.encoding)
+ except UnicodeError:
+ pass
return cursor.execute(query)
except MySQLdb.OperationalError, e:
if e.args[0] in (MySQLdb.constants.CR.SERVER_GONE_ERROR, MySQLdb.constants.CR.SERVER_LOST):
|