From 4933a22991fa547222b43cc29bae267a1ca276c9 Mon Sep 17 00:00:00 2001 From: htxs Date: Wed, 5 Apr 2017 04:26:49 -0700 Subject: [PATCH] [infer][PR] Fix ValueError: unknown locale: UTF-8 Summary: Fix locale.getlocale throw ValueError exception, but not catch. Related issues: #447 #445 #358 Closes https://github.com/facebook/infer/pull/630 Differential Revision: D4834267 Pulled By: jvillard fbshipit-source-id: c66386b --- infer/lib/python/inferlib/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infer/lib/python/inferlib/config.py b/infer/lib/python/inferlib/config.py index 928e2c5ab..b7cba6e89 100644 --- a/infer/lib/python/inferlib/config.py +++ b/infer/lib/python/inferlib/config.py @@ -17,7 +17,7 @@ import os try: locale.setlocale(locale.LC_ALL, '') CODESET = locale.getlocale(locale.LC_CTYPE)[1] -except locale.Error: +except: CODESET = None if CODESET is None: CODESET = 'ascii'