Re: Python 2.5.2 on Ubuntu Hardy Utf-8-Euro error



Josep wrote:

I'm playing with an application framework (or kinda) that's developed
with python, and it throws this error:


File
"/usr/lib/python2.5/site-packages/Dabo-0.8.3-py2.5.egg/dabo/db/dCursorMixin.py",
line 281, in execute
sql = unicode(sql, self.Encoding)
LookupError: unknown encoding: utf_8_euro

At the application (DABO) mailing list, they have pointed that this has
to be a Python issue. As I'm a totally python newbie, I would ask if
somebody has experimented this kind of error, and if there is any known
solution. I've found no clue searching at Google right now.

My Python version is 2.5.2, Ubuntu Hardy .deb package.

Python might get confused by an @EURO suffix in the locale:

$ LANG=de_DE.UTF-8@EURO
$ python -c"import locale; print locale.getdefaultlocale()"
('de_DE', 'utf_8_euro')

Try setting the LANG environment variable to something like

$ LANG=de_DE.UTF-8
$ python -c"import locale; print locale.getdefaultlocale()"
('de_DE', 'UTF8')

before you run your program (use ca_ES or whatever you need instead of
de_DE).

Peter
.



Relevant Pages

  • Re: Learning Tkinter
    ... and how the command option is used to call the function callback. ... gui programming to see if the python programs I have written can be made ... search their computer for this file, execute the python code and then ... This is the meaning of the test on __name__: this magical variable is set to the string '__main__' if and only if the current script is the top-most one, i.e the one you ran python on. ...
    (comp.lang.python)
  • Re: Using Python in ActiveX task - works when run as separate step
    ... when executing the package. ... Peter Yang, if you can detail some of what you did to get Perl working, I'd ... >> was trying to use Python in this case because I know it a little better than ... >>>You could execute the step in DTS package window. ...
    (microsoft.public.sqlserver.dts)
  • Re: Simple Python class questions
    ... code (ie not contained within a def block) in the module might run ... Python starts executing at the top of your main script and then proceeds ... module and execute the lines of code in the module from top to bottom ... then the import simply returns immediately and does the assignment. ...
    (comp.lang.python)
  • Re: Import without executing module
    ... ten different places only the first will compile and execute the code, ... Python user....let me give it a try. ... It is the execution of the byte code that creates the module's namespace ...
    (comp.lang.python)
  • Re: Python, multithreading & GIL
    ... written in Python, and the part written in C - modules written ... actually be executing the interpreter, ... They will execute serially. ... Donn Cave, donn@u.washington.edu ...
    (comp.lang.python)