Mac and Python Error for hg

I was trying with hg (hg is a distributed
version control ) for my Firefox translation Project. Python was installed previously on macBook
(Mac OS X 10.5.4), but while running hg command, it showed error like following:
———–
amanpreet-singh-brars-macbook:~ Preet$ hg ****
Traceback (most recent call last):
File “/usr/local/bin/hg”, line 18, in
mercurial.util.set_binary(fp)
File “/Library/Python/2.5/site-packages/mercurial/demandimport.py”, line 74, in __getattribute__
self._load()
File “/Library/Python/2.5/site-packages/mercurial/demandimport.py”, line 46, in _load
mod = _origimport(head, globals, locals)
File “/Library/Python/2.5/site-packages/mercurial/util.py”, line 33, in
_encoding = locale.getlocale()[1]
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
———
last line was making some know hint, something wrong with locale setting.

Tried to set various setting from terminal, finally it is fixed and here are commands I used

—–
$ printenv LANG

$ export LC_ALL=en_US.UTF-8

$ export LANG=en_US.UTF-8
—–
if you want those changes each time you log-in then make ~/.bashrc file and add
those lines there.

Note: I have not reboot my machine after making those changes, please don’t know
whether work or not;-)

Advertisements

One thought on “Mac and Python Error for hg

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s