From 7be14e4b73cef594a81e8a051ac3e3b60ebb1187 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Tue, 26 Apr 2011 00:21:07 -0700 Subject: Don't try converting non-ascii to HTML entities in unicode. --- Mailman/Utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Mailman/Utils.py') diff --git a/Mailman/Utils.py b/Mailman/Utils.py index 9a29662b..4a9f34a6 100644 --- a/Mailman/Utils.py +++ b/Mailman/Utils.py @@ -432,8 +432,11 @@ _broken_browser = {'\x8b': '‹', '\xbd': '¾', } def websafe(s): - for k in _broken_browser: - s = s.replace(k, _broken_browser[k]) + # Archiver can pass unicode here. Just skip them as the + # archiver escapes non-ascii anyway. + if isinstance(s, str): + for k in _broken_browser: + s = s.replace(k, _broken_browser[k]) # Don't double escape html entities return _ampre.sub(r'&\1', cgi.escape(s, quote=True)) -- cgit v1.2.3