davidmwine / gitinspector

Automatically exported from code.google.com/p/gitinspector
GNU General Public License v3.0
0 stars 0 forks source link

Locale issues when running on Yosemite #53

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run it from a terminal
2.
3.

What is the expected output? What do you see instead?
$ python gitinspector.py -h
Traceback (most recent call last):
  File "gitinspector.py", line 25, in <module>
    localization.init()
  File "/Users/niklasosterlund/Dropbox/public repos/gitinspector/gitinspector/localization.py", line 52, in init
    os.environ['LANG'] = lang[0]
  File "/Applications/anaconda/lib/python2.7/os.py", line 471, in __setitem__
    putenv(key, item)
TypeError: must be string, not None

What version of the product are you using? What version of Python? On what
operating system?
latest version from git repository

Please provide any additional information below.
I fixed it by hard coding something else, like os.environ['LANG'] = "unicode"

If submitting a patch, you guarantee that you are the original author of
the work or that the patch is based on code from a compatible license.

Original issue reported on code.google.com by niklas.o...@gmail.com on 26 Dec 2014 at 9:44

GoogleCodeExporter commented 9 years ago
Hi.

This is a bug in OS X implementation of Python; locale.getdefaultlocale() 
returns None under OS X for some reason. If you set your LANG environment 
variable to the appropriate string it will work. Just add the exports to your 
~/.bash_profile. This has been reported before. I'm merging with the 
appropriate issue.

/Adam Waldenberg

Original comment by gitinspe...@ejwa.se on 27 Dec 2014 at 6:12