[IMP] tools.ustr: fix possible stack overflow for exception_to_unicode + tabs->spaces

bzr revid: odo@openerp.com-20111007144806-lodke0woag32sin5
This commit is contained in:
Olivier Dony 2011-10-07 16:48:06 +02:00
parent 5d8e9b91e5
commit 5aca6a91fa
1 changed files with 28 additions and 28 deletions

View File

@ -168,7 +168,7 @@ def exception_to_unicode(e):
if hasattr(e, 'args'):
return "\n".join((ustr(a) for a in e.args))
try:
return ustr(e)
return unicode(e)
except Exception:
return u"Unknown message"