summaryrefslogtreecommitdiff
path: root/pykolab/utils.py
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-07-16 11:57:11 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-07-16 11:57:11 (GMT)
commit469f9c5520799be5dde1f3d7cba8ce317a9213e9 (patch)
treef40839fe1d5cf4fa16b9fb31d5ded85ab23101fa /pykolab/utils.py
parent1b5a666f9a12d55a382fb608ed2cd03dba3dcf99 (diff)
downloadpykolab-469f9c5520799be5dde1f3d7cba8ce317a9213e9.tar.gz
Escape unsupported locale setting (#883)
Diffstat (limited to 'pykolab/utils.py')
-rw-r--r--pykolab/utils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pykolab/utils.py b/pykolab/utils.py
index 3fb7e34..a4cb2e2 100644
--- a/pykolab/utils.py
+++ b/pykolab/utils.py
@@ -350,7 +350,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',