From 39652bfbf4f598c19f35ecb7f13c092f07468f46 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sat, 23 Jan 2010 15:36:55 +0000 Subject: [PATCH] update regarding Unicode char logging (Bug #148) --- lib/request/connect.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/request/connect.py b/lib/request/connect.py index 3725522cc..738b091d6 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -29,6 +29,7 @@ import time import urllib2 import urlparse import traceback +import unicodedata from lib.contrib import multipartpost from lib.core.convert import urlencode @@ -74,7 +75,7 @@ class Connect: cookieStr = "" requestMsg = "HTTP request:\n%s " % conf.method requestMsg += "%s" % urlparse.urlsplit(url)[2] or "/" - responseMsg = "HTTP response " + responseMsg = u"HTTP response " requestHeaders = "" responseHeaders = "" @@ -227,7 +228,8 @@ class Connect: responseMsg += str(responseHeaders) elif conf.verbose > 4: responseMsg += "%s\n%s\n" % (responseHeaders, page) - + + responseMsg = unicodedata.normalize('NFKD', responseMsg).encode('ascii','ignore') logger.log(8, responseMsg) return page, responseHeaders