473,289 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

Python 2.5.2 on Ubuntu Hardy Utf-8-Euro error

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.

Thanks in advance for your help.

--

Josep SĂ*nchez
[papapep]
----------------------------------
http://extralinux.net
----------------------------------

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQBIP/IZsQfW0y2pjQkRArbaAKCS06qFLqSpCTOIjdprcXz6twxVaACe LSxF
1X1WBK442eY7+z91BeGAmYk=
=7rkf
-----END PGP SIGNATURE-----

Jun 27 '08 #1
8 1455
On May 30, 8:24*am, Josep <papa...@gmail.comwrote:
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.
I've had nothing but problems ever since I upgraded to Hardy. I used
to be a die hard Ubuntu fan until recently. Maybe try a better OS
>
My Python version is 2.5.2, Ubuntu Hardy .deb package.

Thanks in advance for your help.

--

Josep Sŕnchez
[papapep]
----------------------------------http://extralinux.net
----------------------------------

*signature.asc
1KDownload
Jun 27 '08 #2
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
Jun 27 '08 #3
>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.
It's definitely not 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.
The problem is that self.Encoding is incorrect - it should not be
utf_8_euro. Instead, it should be UTF-8 (or perhaps utf_8). DABO
shouldn't use locale.getdefaultlocale()[1], but
locale.getpreferredencoding().

Regards,
Martin
Jun 27 '08 #4
"Martin v. Löwis" wrote:
>>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.

It's definitely not 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.

The problem is that self.Encoding is incorrect - it should not be
utf_8_euro. Instead, it should be UTF-8 (or perhaps utf_8). DABO
shouldn't use locale.getdefaultlocale()[1], but
locale.getpreferredencoding().
I think that is the effect of a bug:
>>locale._parse_localename("en_US.UTF-8@euro")
('en_US', 'utf_8_euro')

The function first normalizes the "@" away and then looks for it. Is that
the expected behaviour?

Peter
Jun 27 '08 #5
On 2008-05-30 17:41, Peter Otten wrote:
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:
Right, that's what's happening.

The locale module uses a locale aliasing table that help map environment
locale settings to C local names.

That table was last updated in 2004 and since then a lot more
locale variable strings have made their way into the Linux
distros.

I guess we need to update the table...
$ 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
--
http://mail.python.org/mailman/listinfo/python-list
--
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source (#1, May 30 2008)
>>Python/Zope Consulting and Support ... http://www.egenix.com/
mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
__________________________________________________ ______________________

:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! ::::
eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
Jun 27 '08 #6
On 2008-05-30 22:37, M.-A. Lemburg wrote:
On 2008-05-30 17:41, Peter Otten wrote:
>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:

Right, that's what's happening.

The locale module uses a locale aliasing table that help map environment
locale settings to C local names.

That table was last updated in 2004 and since then a lot more
locale variable strings have made their way into the Linux
distros.

I guess we need to update the table...
I've opened ticket http://bugs.python.org/issue3011 for this.
>$ 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
--
http://mail.python.org/mailman/listinfo/python-list
--
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source (#1, May 30 2008)
>>Python/Zope Consulting and Support ... http://www.egenix.com/
mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
__________________________________________________ ______________________

:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! ::::
eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
Jun 27 '08 #7
The function first normalizes the "@" away and then looks for it. Is that
the expected behaviour?
I believe this functionality is broken by design. Python can't possibly
know correctly what each locale name on each system means, and what
encoding is used in the locale.

Instead, the system's API to find out the encoding should be used,
as exposed in locale.getpreferredencoding().

Regards,
Martin
Jun 27 '08 #8
Op Fri, 30 May 2008 22:37:14 +0200, schreef M.-A. Lemburg:
On 2008-05-30 17:41, Peter Otten wrote:
>Josep wrote:
>>My Python version is 2.5.2, Ubuntu Hardy .deb package.
>Python might get confused by an @EURO suffix in the locale:
Right, that's what's happening.

The locale module uses a locale aliasing table that help map environment
locale settings to C local names.

That table was last updated in 2004 and since then a lot more locale
variable strings have made their way into the Linux distros.

I guess we need to update the table...
Ubuntu doesn't use @EURO suffixes...?

$ grep EURO /usr/share/i18n/SUPPORTED
$
--
JanC
Jun 27 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Gabby | last post by:
I am attempting to compile python 2.1 from the source on a RedHat 9.0 system. The problem is that a openssl header file (kssl.h) requires krb5.h which isn't in the usual place (/usr/include). ...
5
by: Py PY | last post by:
(Apologies if this appears twice. I posted it yesterday and it was held due to a 'suspicious header') I'm having a hard time trying to get a couple of tests to pass when compling Python 2.3.5 on...
1
by: could.net | last post by:
I use boost 1.33_1, there's an example on boost::python named embedding.cpp. When I tried to build and run it in visual studio 2005, I got an error on this line: std::string hello() { return...
852
by: Mark Tarver | last post by:
How do you compare Python to Lisp? What specific advantages do you think that one has over the other? Note I'm not a Python person and I have no axes to grind here. This is just a question for...
1
by: llothar | last post by:
Why does Python2.5 do not include the amalgamation source code of sqlite3? At the moment it is not possible to build the system out of the box with the Visual Studio project. I don't think this...
1
by: SPE - Stani's Python Editor | last post by:
Hi All, If you wrote some python code that you want to package or know a cool python application of which you like to make a deb installer, the python packaging session is all for you! Do you...
0
by: Lie | last post by:
Yesterday I installed compiz-icon in my Ubuntu. Today, when I go to the python interpreter, I happen to do this: ### START OF PYTHON SESSION ### Python 2.5.2 (r252:60911, Apr 21 2008, 11:17:30)...
3
by: azrael | last post by:
Hy folks A friend of mine told me something about Guido and google developing an Ubuntu distribution based and totaly oriented for the Python appliction development. I googled for it with no...
15
by: skip | last post by:
If you're an Emacs user who has used both python-mode.el (the python mode code distributed with Python and XEmacs) and python.el (the python mode code distributed with GNU Emacs), I'd like to get...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.