From 06a964a3a1d7b13ff934a3fb4ffa66bfdece72ba Mon Sep 17 00:00:00 2001 From: pi-rho Date: Wed, 30 Jan 2013 15:02:41 -0600 Subject: [PATCH] more robust escaping/encoding --- netarch/ip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netarch/ip.py b/netarch/ip.py index 8865225..1d703f8 100644 --- a/netarch/ip.py +++ b/netarch/ip.py @@ -808,7 +808,7 @@ class HtmlSession(Session): def log(self, frame, payload, escape=True): if escape: - p = cgi.escape(unicode(payload)) + p = cgi.escape(payload).encode('ascii', 'xmlcharrefreplace') else: p = payload if frame.saddr == self.srv: