Staszek <stf.list.ot...@eisenbits.com> wrote:

> On 2014-12-04 18:04, Michael Bayer wrote:
>>> On Dec 4, 2014, at 3:46 AM, Staszek <stf.list.ot...@eisenbits.com> wrote:
>>> 
>>> On 2014-12-04 08:23, Staszek wrote:
>>>> On 2014-11-29 16:19, Michael Bayer wrote:
>>>>> SQLAlchemy shouldn’t be attempting to run this decode operation unless 
>>>>> the MySQL driver used here is acting in a flaky way, that is, SQLAlchemy 
>>>>> did a test on first connect to see if a Unicode() type comes back as u’’ 
>>>>> or not.   That it’s trying to do the decode means that it didn’t, yet 
>>>>> then on this column it is.
>>>>> 
>>>>> The MySQL driver in use here would be of top importance in determining 
>>>>> why this might be happening, I guess this is the “gaerdbms” driver?
>>>> 
>>>> Yes.
>>>> 
>>>>> So the best approach for MySQL is to ensure that the driver is 
>>>>> predictable about unicode include, specify use_unicode=0 in the URL (see 
>>>>> http://docs.sqlalchemy.org/en/rel_0_9/dialects/mysql.html#unicode).
>>>> 
>>>> That's what I did.
>>>> 
>>>> It helped for a while, then the problem returned. What's going on here?
>>> 
>>> I tried adding:
>>> 
>>> use_unicode=0
>>> 
>>> . Now I did this:
>>> 
>>> charset=utf8&use_unicode=0
>>> 
>>> and it helped again (we can process operations with Polish diacritics
>>> with no problem). Let's see for how long... This is Google App Engine,
>>> so Google is creating multiple instances of the app dynamically. Can
>>> this be an issue?
>> 
>> the charset=utf8&use_unicode=0 setting is what I’ve been recommending for 
>> all MySQL setups for years.
> 
> The problem seems to have returned (no code change since, and the stack
> trace looks exactly the same). Is there anything else we might need to set?

turning off the driver’s unicode returns is the most we can do on my end, short 
of creating a type decorator that literally checks each string to see if its 
unicode already; this is doable but will make string values perform much more 
poorly in result sets due to the checking.   Unfortunately GAE doesn’t have the 
best reputation for being a straightforward environment, this kind of issue I 
usually want to get in on a pdb session to examine the output at each step, not 
sure if that’s an option in the GAE environment.





> 
> -- 
> http://people.eisenbits.com/~stf/
> http://www.eisenbits.com/
> 
> OpenPGP: 80FC 1824 2EA4 9223 A986  DB4E 934E FEA0 F492 A63B
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to