09 August, 2008

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;-)

5 comments:

ਅ. ਸ. ਆਲਮ (A S Alam) said...

oh, .bashrc is not working for me:-(

Arvinder Kang said...
This comment has been removed by the author.
Arvinder Kang said...

Why don't you give git a try. I have stopped using Subversion completely and although I have never used mercurial, git is a very different approach to version control. The Linux Kernal is maintained using git. I did a small post on git configurations on my Leopard machine here.

ਅ. ਸ. ਆਲਮ (A S Alam) said...

It this possible to use git with svn, while upstream using svn? I was thinking that version control depends upon upstream as mozilla use HG and kde/gnome use svn.

Arvinder Kang said...

Many people do that. This might be a good place to start http://www.flavio.castelli.name/howto_use_git_with_svn