From 697b32554cff42a8944a307234322da8d2071a60 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 12 Nov 2010 11:48:25 +0000 Subject: [PATCH] fix for a bug "ordinal not in range(128)" reported by bugtrace --- lib/core/common.py | 2 +- lib/request/connect.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/core/common.py b/lib/core/common.py index f59170ec7..354356283 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1095,7 +1095,7 @@ def sanitizeAsciiString(subject): if ord(subject[i]) >= 128: index = i break - if not index: + if index is None: return subject else: return subject[:index] + "".join(subject[i] if ord(subject[i]) < 128 else '?' for i in xrange(index, len(subject))) diff --git a/lib/request/connect.py b/lib/request/connect.py index 36bf11c80..1dee40b39 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -279,6 +279,7 @@ class Connect: socket.setdefaulttimeout(conf.timeout) page = sanitizeAsciiString(page) + page = getUnicode(page) parseResponse(page, responseHeaders) responseMsg += "[#%d] (%d %s):\n" % (requestID, code, status)