By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,932 Members | 1,944 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,932 IT Pros & Developers. It's quick & easy.

ValueError: unknown locale: UTF-8

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
mr
On Jun 1, 8:43 pm, "Martin v. Lwis" <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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.