Jorge Vargas schrieb:

> On 12/5/06, Nicky Ayoub <[EMAIL PROTECTED]> wrote:
> > The short answer is 'NO'...
> >
> ummm it will be nice if you could track it donw and report to either
> SO or mysqldb.
>
> I remenber flashing a thread about this and it was supposed to be fix
> in one of the newer mysqldb versions.

The problem is known to Oleg, but this "fix" is in Olegs opinion a
hack.  SO internally is not unicode aware, and according to Oleg
queries should not be performed using unicode.  This means, that one
has to specify the encoding explicitly.  It is documented here:
  http://www.sqlobject.org/SQLObject.html#column-types
in the examples of UnicodeCol.

However, I also use an equivalent hack in my Application (not a
TurboGears but a Desktop app which happens to use SO), using the
following more "pythonic" patch for mysqlconnection.py:

74c74
<                 if self.need_unicode:
---
>                 if self.need_unicode and not isinstance(query, unicode):

(When I developed my app using SQLite, it had no problems using unicode
queries.  When I changed it to also use MySQL, I did not want to change
all the queries, so I use this patch, which works just fine.)

Cheers,
Markus


> > This all goes back the the unicode issues of MySQL in python. I don't know
> > if this is THE fix but it fixes the problem I have using TG. I found it
> > floating around on this group somewhere. I didn't come up with it. My guess
> > is is simply a hack that masks a root cause issue...
> >
> > On 12/4/06, Jorge Vargas <[EMAIL PROTECTED]> wrote:
> > >
> > > On 12/4/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > > >
> > > > I just installed SO 0.7.2 and ran it against my app using the svn trunk
> > > > version of TG.
> > > >
> > > > I had to modify the mysqlconnection.py file to include the unicode test
> > > > at line 77 again. After that, my app seems to be happy again...
> > > >
> > > again? did you reported this to SO mailing list?
> > >
> > > > - myquery = unicode(query, self.encoding)
> > > >
> > > > + if type(query) != unicode:
> > > > +     myquery = unicode(query, self.encoding )
> > > > + else:
> > > > +     myquery = query
> > > >
> > > >
> > > > Nicky
> > > >
> > > >
> > > > >
> > > >
> > >
> > >
> >
> >
> >
> > --
> > --
> > Nicky Ayoub
> > G-Mail Account


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to