Surpassed the exception when resetting locale for non-utf8 encodings

bzr revid: jvo@tinyerp.com-20090128090043-j5g25o3q8qqzd0uy
This commit is contained in:
Jay (Open ERP)
2009-01-28 14:30:43 +05:30
parent 386f08b122
commit be0001900a
+4 -1
View File
@@ -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)