This commit is contained in:
Miroslav Stampar
2015-09-15 13:26:25 +02:00
parent 5de1825d0c
commit ee38574449
2 changed files with 15 additions and 8 deletions

View File

@@ -3979,7 +3979,7 @@ def pollProcess(process, suppress_errors=False):
break
def getSafeExString(ex):
def getSafeExString(ex, encoding=None):
"""
Safe way how to get the proper exception represtation as a string
(Note: errors to be avoided: 1) "%s" % Exception(u'\u0161') and 2) "%s" % str(Exception(u'\u0161'))
@@ -3992,4 +3992,4 @@ def getSafeExString(ex):
elif getattr(ex, "msg", None):
retVal = ex.msg
return getUnicode(retVal)
return getUnicode(retVal, encoding=encoding)