aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Handlers/Decorate.py
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2008-12-07 09:41:12 -0800
committerMark Sapiro <mark@msapiro.net>2008-12-07 09:41:12 -0800
commit2274e704c435716f33ed9dabcb80bef0811ba50c (patch)
tree7148d1d60b9be31e2a36e33d3c0a6dbab117900f /Mailman/Handlers/Decorate.py
parent2137e2b32bd44f8666369b8469a63d12be59e14d (diff)
downloadmailman2-2274e704c435716f33ed9dabcb80bef0811ba50c.tar.gz
mailman2-2274e704c435716f33ed9dabcb80bef0811ba50c.tar.xz
mailman2-2274e704c435716f33ed9dabcb80bef0811ba50c.zip
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.
Diffstat (limited to '')
-rw-r--r--Mailman/Handlers/Decorate.py12
1 files changed, 10 insertions, 2 deletions
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''