From eac89c5439c99337dd94618f17cb5ab3827527bd Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 20 Dec 2010 09:55:44 -0700 Subject: [PATCH] Linux binary build: If setting system default locale fails, try setting locale to en_US.UTF-8 instead --- setup/installer/linux/freeze2.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup/installer/linux/freeze2.py b/setup/installer/linux/freeze2.py index df2c1d6480..7a2980039e 100644 --- a/setup/installer/linux/freeze2.py +++ b/setup/installer/linux/freeze2.py @@ -318,7 +318,11 @@ class LinuxFreeze(Command): import codecs def set_default_encoding(): - locale.setlocale(locale.LC_ALL, '') + try: + locale.setlocale(locale.LC_ALL, '') + except: + print 'WARNING: Failed to set default libc locale, using en_US' + locale.setlocale(locale.LC_ALL, 'en_US.UTF-8') enc = locale.getdefaultlocale()[1] if not enc: enc = locale.nl_langinfo(locale.CODESET)