From be0001900ad367a7bd8775de893fc1b434c93b62 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 28 Jan 2009 14:30:43 +0530 Subject: [PATCH] Surpassed the exception when resetting locale for non-utf8 encodings bzr revid: jvo@tinyerp.com-20090128090043-j5g25o3q8qqzd0uy --- bin/tools/translate.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/tools/translate.py b/bin/tools/translate.py index 749ab04f6ec..0dbc0183dd7 100644 --- a/bin/tools/translate.py +++ b/bin/tools/translate.py @@ -567,7 +567,10 @@ def trans_load_data(db_name, fileobj, fileformat, lang, strict=False, lang_name= 'decimal_point' : str(locale.nl_langinfo(locale.RADIXCHAR)), 'thousands_sep' : str(locale.nl_langinfo(locale.THOUSEP)) }) - locale.resetlocale(locale.LC_ALL) + try: + locale.resetlocale(locale.LC_ALL) + except: + pass lang_ids = lang_obj.search(cr, uid, []) langs = lang_obj.read(cr, uid, lang_ids) ls = map(lambda x: (x['code'],x['name']), langs)