473,287 Members | 3,181 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,287 software developers and data experts.

ValueError: unknown locale: UTF-8

On OS X 10.5.2 :

$ python
Python 2.5.1 (r251:54863, Feb 4 2008, 21:48:13)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>import locale
locale.getdefaultlocale()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/locale.py", line 441, in getdefaultlocale
return _parse_localename(localename)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/locale.py", line 373, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
>>>
This is on open bug or is there more to it?

Regards, mario
Jun 27 '08 #1
4 6640
Mario Ruggier <ma***@ruggier.orgwrites:
On OS X 10.5.2 :

$ python
Python 2.5.1 (r251:54863, Feb 4 2008, 21:48:13)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>import locale
locale.getdefaultlocale()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/locale.py", line 441, in getdefaultlocale
return _parse_localename(localename)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/locale.py", line 373, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
>>>>

This is on open bug or is there more to it?

Regards, mario
Works for me (10.5.3):

marigold:~ arno$ uname -srv
Darwin 9.3.0 Darwin Kernel Version 9.3.0: Fri May 23 00:49:16 PDT 2008; root:xnu-1228.5.18~1/RELEASE_I386
marigold:~ arno$ python -c "import locale; print locale.getdefaultlocale()"
('en_GB', 'UTF8')

--
Arnaud
Jun 27 '08 #2
ValueError: unknown locale: UTF-8
>>>>

This is on open bug or is there more to it?
Do you have an environment variable set who is named
either LANG or starts with LC_?

Regards,
Martin
Jun 27 '08 #3
mr
On Jun 1, 8:43 pm, "Martin v. Löwis" <mar...@v.loewis.dewrote:
ValueError: unknown locale: UTF-8
This is on open bug or is there more to it?

Do you have an environment variable set who is named
either LANG or starts with LC_?
Actually, yes:

LC_CTYPE=UTF-8

where is it coming from? This is basically on a clean new machine...
who might be setting it? It is coming from a program elsewhere on the
system? How should python code deal with this?

Thanks! mario
Jun 27 '08 #4
Actually, yes:
>
LC_CTYPE=UTF-8

where is it coming from? This is basically on a clean new machine...
who might be setting it?
There are many possible places. grep in your Library, as a starting
point. As on Macintosh lists.
It is coming from a program elsewhere on the
system? How should python code deal with this?
Python should do what it does: just crash. This setting is not supported.

Regards,
Martin
Jun 27 '08 #5

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

Similar topics

3
by: Philipp Lenssen | last post by:
I want to try the new Yahoo API, but I get the PHP5 error message Unknown encoding "utf-8" in the marked line below... (After that, applying the Xpath will fail as symptom of the first bug.) ...
6
by: Stas Z | last post by:
Hello, Just noticed that the locale 'nb_NO' is not supported in Python?! stas@mobi:~$ locale LANG=nb_NO stas@mobi:~$ python Python 2.3.4 (#2, Sep 24 2004, 08:39:09)
8
by: davihigh | last post by:
My Friends: I am using std::ofstream (as well as ifstream), I hope that when i wrote in some std::string(...) with locale, ofstream can convert to UTF-8 encoding and save file to disk. So does...
12
by: Sachin Punjabi | last post by:
Hi, I wanted to read a file encoded in utf-8 and and using the following syntax in my source which throws me an error specifying Lookuperror : unknown encoding : utf-8. Also I am working on...
2
by: mpalomas | last post by:
Hi C++ folks, I have trouble to open files whose path contains non-ascii characters with std::ifstream. For instance let's say i just have a file which has Japanese characters either in the...
2
by: maxinbjohn | last post by:
Dear friends, I am a Python programmer from Kerala, India. When I tried to run a simple python program which uses the Malayalam language (ml), import os import locale os.environ='ml' print...
2
by: Mario Ruggier | last post by:
On OS X 10.5.2 : $ python Python 2.5.1 (r251:54863, Feb 4 2008, 21:48:13) on darwin Type "help", "copyright", "credits" or "license" for more information. Traceback (most recent call last):...
3
by: Mario Ruggier | last post by:
Hi, i had the following problem when installing py3.0rc1 on a Mac OS X 10.5.5. On this system, the default locale values are: $ locale LANG= LC_COLLATE="C" LC_CTYPE="UTF-8" LC_MESSAGES="C"
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: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

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.