jijo-paulose / ulipad

Automatically exported from code.google.com/p/ulipad
0 stars 0 forks source link

locale exception #194

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. just start it in any mac machine...

What is the expected output? What do you see instead?
>>puneet-madaans-macbook-pro:ulipad puma2823$ python ulipad.py
Traceback (most recent call last):
  File "ulipad.py", line 50, in <module>
    ini = common.get_config_file_obj()
  File "/Users/puma2823/Downloads/ulipad/modules/common.py", line 323, in 
get_config_file_obj
    _config_ini = dict4ini.DictIni(get_config_file(), *args, **kwargs)
  File "/Users/puma2823/Downloads/ulipad/modules/dict4ini.py", line 258, in __init__
    self._encoding = getdefaultencoding(encoding)
  File "/Users/puma2823/Downloads/ulipad/modules/dict4ini.py", line 606, in 
getdefaultencoding
    encoding = locale.getdefaultlocale()[1]
  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

Please use labels and text to provide additional information.
>>i think it make sense to catch exception and using a default locale , as 
en_US as default... 
anyways other option is to put a shell script with two export statements..

puneet-madaans-macbook-pro:ulipad puma2823$ export LC_ALL=en_US.UTF-8
puneet-madaans-macbook-pro:ulipad puma2823$ export LANG=en_US.UTF-8

Original issue reported on code.google.com by puneetma...@gmail.com on 14 Jul 2009 at 11:31

GoogleCodeExporter commented 9 years ago
I've fixed the dict4ini bug, if there is an exception when executing 
getdefaultlocale(), then the encoding will be utf-8. And you can try svn 
version to see 
if it works.

Original comment by limo...@gmail.com on 30 Jul 2009 at 2:11