From 2274e704c435716f33ed9dabcb80bef0811ba50c Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Sun, 7 Dec 2008 09:41:12 -0800 Subject: Fixed a problem in Decorate which could throw a TypeError on conversion to unicode of a header/footer that was already unicode because of interpolating a unicode value. Made a minor change to the authentication logic for displaying hidden members on the roster. --- Mailman/Handlers/Decorate.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Mailman/Handlers') diff --git a/Mailman/Handlers/Decorate.py b/Mailman/Handlers/Decorate.py index fa6c3a80..4a6fb8aa 100644 --- a/Mailman/Handlers/Decorate.py +++ b/Mailman/Handlers/Decorate.py @@ -98,8 +98,16 @@ def process(mlist, msg, msgdata): # TK: Try to keep the message plain by converting the header/ # footer/oldpayload into unicode and encode with mcset/lcset. # Try to decode qp/base64 also. - uheader = unicode(header, lcset, 'ignore') - ufooter = unicode(footer, lcset, 'ignore') + # It is possible header/footer is already unicode if it was + # interpolated with a unicode. + if isinstance(header, unicode): + uheader = header + else: + uheader = unicode(header, lcset, 'ignore') + if isinstance(footer, unicode): + ufooter = footer + else: + ufooter = unicode(footer, lcset, 'ignore') try: oldpayload = unicode(msg.get_payload(decode=True), mcset) frontsep = endsep = u'' -- cgit v1.2.3