Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

locale.Error: unsupported locale setting #93

Closed
dyong0 opened this issue Jan 18, 2017 · 2 comments
Closed

locale.Error: unsupported locale setting #93

dyong0 opened this issue Jan 18, 2017 · 2 comments

Comments

@dyong0
Copy link

dyong0 commented Jan 18, 2017

Hi I run percol right after installing but I got an error.
So I looked in the code and found the reason why I got this error.
Anybody else got the same error?

Traceback (most recent call last):
  File "/usr/local/bin/percol", line 14, in <module>
    main()
  File "/usr/local/lib/python2.7/site-packages/percol/cli.py", line 186, in main
    output_encoding = set_proper_locale(options)
  File "/usr/local/lib/python2.7/site-packages/percol/cli.py", line 122, in set_proper_locale
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 581,in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

I fixed this proble by just putting specific locale "C" into the second parameter.
@line 122

locale.setlocale(locale.LC_ALL, 'C')
@kaiwk
Copy link

kaiwk commented Jan 5, 2018

Similar error in Emacs ansi-term but python3, it works fine in Mac Terminal though.

~$ percol 
Traceback (most recent call last):
  File "/usr/local/bin/percol", line 14, in <module>
    main()
  File "/usr/local/lib/python3.6/site-packages/percol/cli.py", line 186, in main
    output_encoding = set_proper_locale(options)
  File "/usr/local/lib/python3.6/site-packages/percol/cli.py", line 122, in set_proper_locale
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/locale.py", line 598, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting
~$ 

@kaiwk
Copy link

kaiwk commented Jan 9, 2018

It seems Emacs ansi-term will not read ~/.profile, so after source ~/.profile, everything is fine. Also, it's a bad idea use it in any Emacs shell emulator.

@dyong0 Maybe you should check your locale setting.

@mooz mooz closed this as completed in #94 Apr 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants