No, use_unicode affect only output of MySQLdb.
I found problem:
On my hosting with CentOS 5.2 file
/usr/lib/python2.4/site-packages/MySQLdb/cursors.py
contains this code:
-----------------------------------------------------------------
        from types import ListType, TupleType
        from sys import exc_info
        del self.messages[:]
        db = self._get_db()
        charset = db.character_set_name()
        >>>>query = query.encode(charset)
        if args is not None:
            query = query % db.literal(args)
        try:
            r = self._query(query)
--------------------------------------------------------------------
>>> MySQLdb.__version__
'1.2.1'
--------------------------------------------------------------------


And on my home computer:
--------------------------------------------------------------------
        from types import ListType, TupleType
        from sys import exc_info
        del self.messages[:]
        db = self._get_db()
        charset = db.character_set_name()
        >>>>if isinstance(query, unicode):
        >>>>    query = query.encode(charset)
        if args is not None:
            query = query % db.literal(args)
        try:
            r = self._query(query)
--------------------------------------------------------------------
>>> MySQLdb.__version__
'1.2.2'
--------------------------------------------------------------------

So, bug exist in MySQLdb.
And on CentOS 5.2 it seems that i must handle it by my own.... :(

Thank for you help, massimo !

On 14 июл, 00:39, mdipierro <[email protected]> wrote:
> perhaps it should be
>
> MySQLdb.connect(use_unicode=False)
>
> Strange I never had a problem with this?
>
> On Jul 13, 10:04 am, "ont.rif" <[email protected]> wrote:
>
> > In short:
> > MySQLdb "execute" expect <type 'unicode'> string but web2py pass <type
> > 'str'> object to it.
> > May be this is a problem ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to