Solution to python error: raise ValueError, ‘unknown locale: %s’ % localename

Symptoms:

Traceback (most recent call last):
File "./gitinspector.py", line 25, in
localization.init()

File "/Users/nocoo/Downloads/gitinspector-0.3.2/gitinspector/localization.py", line 43, in init
lang = locale.getlocale()

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 530, in getlocale
return _parse_localename(localename)

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 443, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename

Solution:
unset LANG
env | grep LC_
export LC_CTYPE="UTF-8"
env | grep LC_

发表评论