diff options
author | Mark Sapiro <msapiro@value.net> | 2011-04-26 00:21:07 -0700 |
---|---|---|
committer | Mark Sapiro <msapiro@value.net> | 2011-04-26 00:21:07 -0700 |
commit | 7be14e4b73cef594a81e8a051ac3e3b60ebb1187 (patch) | |
tree | a4c2aa039e5dd0640a877edce2638cd5c85fffb0 | |
parent | 2543ff77800469cdb83051784f22de049b2e5db1 (diff) | |
download | mailman2-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.py | 7 |
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': '‹', '\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)) |