diff --git a/infer/lib/python/inferlib/config.py b/infer/lib/python/inferlib/config.py index 69be17547..8d1402e5f 100644 --- a/infer/lib/python/inferlib/config.py +++ b/infer/lib/python/inferlib/config.py @@ -14,8 +14,11 @@ import locale import os -locale.setlocale(locale.LC_ALL, '') -CODESET = locale.getlocale(locale.LC_CTYPE)[1] +try: + locale.setlocale(locale.LC_ALL, '') + CODESET = locale.getlocale(locale.LC_CTYPE)[1] +except locale.Error: + CODESET = None if CODESET is None: CODESET = 'ascii'