summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-07-16 12:57:11 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-07-16 12:57:31 +0100
commit178687649d3b74e472b1751ded10304a168391d3 (patch)
tree0c20c55745c37c15532157edeba9b9c13645c3a9
parentb943d50785124daaaabffe08e70590a55598ed48 (diff)
downloadpykolab-178687649d3b74e472b1751ded10304a168391d3.tar.gz
Escape unsupported locale setting (#883)
-rw-r--r--pykolab/utils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pykolab/utils.py b/pykolab/utils.py
index a8ad952..a518204 100644
--- a/pykolab/utils.py
+++ b/pykolab/utils.py
@@ -287,7 +287,10 @@ def translate(mystring, locale_name='en_US'):
else:
locale_charset = 'utf-8'
- locale.setlocale(locale.LC_ALL, (locale_name,locale_charset))
+ try:
+ locale.setlocale(locale.LC_ALL, (locale_name,locale_charset))
+ except Error, errmsg:
+ pass
command = [ '/usr/bin/iconv',
'-f', 'UTF-8',