From 313744ee350d98971b181f607d44d66de6966f2d Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Thu, 29 Jan 2009 09:35:49 +0200 Subject: [PATCH] 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 --- bin/netsvc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/netsvc.py b/bin/netsvc.py index 1f1904ac179..36e88add4a2 100644 --- a/bin/netsvc.py +++ b/bin/netsvc.py @@ -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,))