more robust escaping/encoding

This commit is contained in:
pi-rho 2013-01-30 15:02:41 -06:00
parent 3e1dfcba49
commit 06a964a3a1
1 changed files with 1 additions and 1 deletions

View File

@ -808,7 +808,7 @@ class HtmlSession(Session):
def log(self, frame, payload, escape=True): def log(self, frame, payload, escape=True):
if escape: if escape:
p = cgi.escape(unicode(payload)) p = cgi.escape(payload).encode('ascii', 'xmlcharrefreplace')
else: else:
p = payload p = payload
if frame.saddr == self.srv: if frame.saddr == self.srv: