'ValueError: unknown locale: UTF-8' problem in Mac OS X 10.5 Leopard [solved (more or less)]

Oscar Sanchez Casamitjana osc.lists at gmail.com
Sun Oct 28 17:51:23 CDT 2007


On 10/28/07, Jens Alfke <jens at mooseyard.com> wrote:
> On 28 Oct '07, at 7:26 AM, Oscar Sanchez Casamitjana wrote:
> yes, it's me again. apparently the problem lays on (my) Terminal.app,
> downloaded iTerm and worked without problems.
>
> Hm, that's strange. I've been using Mercurial on Leopard (with Terminal.app)
> for months without problems. I just download and build using the standard
> Python 2.5, not MacPorts.
>
> I do know the new version of Terminal has some changes to the way it handles
> character sets. I checked my Terminal prefs, and in the Settings tab, under
> Advanced, I have "Character encoding:" set to UTF-8, and the "Set LANG
> environment variable" checkbox is turned on. In the sh
ell, I get:
>
> $ printenv LANG
> en_US.UTF-8

with same settings as you (advanced + set LANG):

$ printenv LANG
UTF-8

$ hg
Traceback (most recent call last):
  File "/usr/local/bin/hg", line 14, in <module>
    mercurial.dispatch.run()
  File "/usr/local/lib/python2.5/site-packages/mercurial/dispatch.py",
line 20, in run
  File "/usr/local/lib/python2.5/site-packages/mercurial/dispatch.py",
line 26, in dispatch
  File "/usr/local/lib/python2.5/site-packages/mercurial/demandimport.py",
line 74, in __getattribute__
  File "/usr/local/lib/python2.5/site-packages/mercurial/demandimport.py",
line 46, in _load
  File "/usr/local/lib/python2.5/site-packages/mercurial/util.py",
line 32, in <module>
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/locale.py",
line 460, in getlocale
    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

isn't it strange...


oscar.


More information about the Mercurial mailing list