Logger: if unicode fails, try plain str decoding.
It is just a second attempt to get the message out instead of raising an exception in the wrong place there. bzr revid: p_christ@hol.gr-20090129073549-voc3eg28xitx6tzt
This commit is contained in:
parent
876e0667e6
commit
313744ee35
|
@ -163,7 +163,10 @@ class Logger(object):
|
|||
if isinstance(msg, Exception):
|
||||
msg = tools.exception_to_unicode(msg)
|
||||
|
||||
result = tools.ustr(msg).strip().split('\n')
|
||||
try:
|
||||
result = tools.ustr(msg).strip().split('\n')
|
||||
except UnicodeDecodeError:
|
||||
result = msg.strip().split('\n')
|
||||
if len(result)>1:
|
||||
for idx, s in enumerate(result):
|
||||
level_method('[%02d]: %s' % (idx+1, s,))
|
||||
|
|
Loading…
Reference in New Issue