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: