aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Sapiro <msapiro@value.net>2011-04-26 00:21:07 -0700
committerMark Sapiro <msapiro@value.net>2011-04-26 00:21:07 -0700
commit7be14e4b73cef594a81e8a051ac3e3b60ebb1187 (patch)
treea4c2aa039e5dd0640a877edce2638cd5c85fffb0
parent2543ff77800469cdb83051784f22de049b2e5db1 (diff)
downloadmailman2-7be14e4b73cef594a81e8a051ac3e3b60ebb1187.tar.gz
mailman2-7be14e4b73cef594a81e8a051ac3e3b60ebb1187.tar.xz
mailman2-7be14e4b73cef594a81e8a051ac3e3b60ebb1187.zip
Don't try converting non-ascii to HTML entities in unicode.
-rw-r--r--Mailman/Utils.py7
1 files changed, 5 insertions, 2 deletions
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': '&#8249;',
'\xbd': '&#190;',
}
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))