mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
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:
commit
073fb2bdea
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue