Merge pull request #26064 from s0undt3ch/issues/26063-unknown-locale

Don't stacktrace when trying to get the default locale.
This commit is contained in:
Nicole Thomas 2015-08-06 10:11:05 -06:00
commit 073fb2bdea

View file

@ -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