Skip to content

Commit

Permalink
Don't stacktrace when trying to get the default locale.
Browse files Browse the repository at this point in the history
  • Loading branch information
s0undt3ch committed Aug 6, 2015
1 parent 0f44761 commit 8c6ab78
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion salt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ def __define_global_system_encoding_variable__():
# encoding. MS Windows has problems with this and reports the wrong
# encoding
import locale
encoding = locale.getdefaultlocale()[-1]
try:
encoding = locale.getdefaultlocale()[-1]
except ValueError:
# A bad locale setting was most likely found:
# https://github.com/saltstack/salt/issues/26063
pass

# This is now garbage collectable
del locale
Expand Down

0 comments on commit 8c6ab78

Please sign in to comment.