$ 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
Do you have an environment variable set who is named
either LANG or starts with LC_?
Regards,
Martin
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
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