in fact its almost definitely a bug in mysqldb - mysqldb should be
detecting "unicode" instances at on the bind parameter side and
encoding based on that (otherwise doing nothing), and decoding into
"unicode" instances at the result set level.  if it did that, then it
would not conflict with the Unicode type on SQLAlchemy's side.  here is
the source to the SA unicode type:

class Unicode(TypeDecorator):
    impl = String
    def convert_bind_param(self, value, dialect):
         if value is not None and isinstance(value, unicode):
              return value.encode(dialect.encoding)
         else:
              return value
    def convert_result_value(self, value, dialect):
         if value is not None and not isinstance(value, unicode):
             return value.decode(dialect.encoding)
         else:
             return value

as evidence of this, the above Unicode type works completely fine with
pysqlite, which also accepts unicode bind params and returns all string
values as unicodes.


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to