On Jul 25, 2008, at 5:34 AM, Raoul Snyman wrote:

> I'm writing a Pylons app, connecting to an existing oldish database,
> and while connecting from my Mac desktop everything is fine, but when
> I connect from our dev server, I get the following error:
>
> LookupError: unknown encoding: latin1_swedish_ci
>
> I've done some Googling, found a couple of posts on here, as well as
> elsewhere, and I'm not sure what they're talking about in those posts
> (specifically, I don't see how they solved the problem).

Hi Raoul,
I'd guess that this error is coming from Python's codecs module,  
probably indirectly from a call to unicode() with the encoding param  
set to 'latin1_swedish_ci'.

It looks like that's the default for MySQL installations:
http://dev.mysql.com/doc/refman/5.0/en/charset-we-sets.html

But Python's never heard of it:
http://docs.python.org/lib/standard-encodings.html

 >>> import codecs
 >>> codecs.lookup("latin1_swedish_ci")
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
LookupError: unknown encoding: latin1_swedish_ci
 >>>


So my guess is that SA is reading the encoding from the database and  
then trying to convert text fields to Unicode and getting the error  
above. Why this happens on one box and not another is mysterious. I'm  
also on a Mac and it knows nothing about latin1_swedish_ci, so I don't  
know why yours would be any different. Has your Mac Python perhaps  
been compiled with some MySQL-awareness? If you run this at the  
command line on your Mac, what does it report?

python -c "import codecs; codecs.lookup('latin1_swedish_ci')"


Cheers
Philip


--~--~---------~--~----~------------~-------~--~----~
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