Skip to content

Commit

Permalink
Merge pull request #94 from quiver/fix-locale-setting
Browse files Browse the repository at this point in the history
When locale is not initialized, skip setlocale
  • Loading branch information
mooz authored Apr 9, 2018
2 parents aaae4c1 + 11c8c1b commit dac0389
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion percol/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ def setup_options(parser):
help = "exit immediately with doing nothing to cache module files and speed up start-up time")

def set_proper_locale(options):
locale.setlocale(locale.LC_ALL, '')
try:
locale.setlocale(locale.LC_ALL, '')
except Exception as e:
debug.log("Exception in setlocale", e)
output_encoding = locale.getpreferredencoding()
if options.output_encoding:
output_encoding = options.output_encoding
Expand Down

0 comments on commit dac0389

Please sign in to comment.