aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Handlers
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2009-07-31 15:37:29 -0700
committerMark Sapiro <mark@msapiro.net>2009-07-31 15:37:29 -0700
commitf2396437f76d97fefedb55179390851c4fd05592 (patch)
tree3e30e9be19ef4cabb21b9bf08d541b82e70c7269 /Mailman/Handlers
parent0f74db6fb0ae5a4fcdfaaf1976d196efc01ab0b0 (diff)
downloadmailman2-f2396437f76d97fefedb55179390851c4fd05592.tar.gz
mailman2-f2396437f76d97fefedb55179390851c4fd05592.tar.xz
mailman2-f2396437f76d97fefedb55179390851c4fd05592.zip
Backported several bug fixes from the 2.2 branch.
Diffstat (limited to 'Mailman/Handlers')
-rw-r--r--Mailman/Handlers/MimeDel.py4
-rw-r--r--Mailman/Handlers/Scrubber.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/Mailman/Handlers/MimeDel.py b/Mailman/Handlers/MimeDel.py
index 523b3dfc..a1a20205 100644
--- a/Mailman/Handlers/MimeDel.py
+++ b/Mailman/Handlers/MimeDel.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2007 by the Free Software Foundation, Inc.
+# Copyright (C) 2002-2009 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -183,7 +183,7 @@ def collapse_multipart_alternatives(msg):
try:
firstalt = subpart.get_payload(0)
newpayload.append(firstalt)
- except IndexError:
+ except (IndexError, TypeError):
pass
else:
newpayload.append(subpart)
diff --git a/Mailman/Handlers/Scrubber.py b/Mailman/Handlers/Scrubber.py
index 64b46eaf..a990d721 100644
--- a/Mailman/Handlers/Scrubber.py
+++ b/Mailman/Handlers/Scrubber.py
@@ -262,7 +262,7 @@ URL: %(url)s
# mono-space font. Still looks hideous to me, but then I'd
# just as soon discard them.
def doreplace(s):
- return s.replace(' ', '&nbsp;').replace('\t', '&nbsp'*8)
+ return s.expandtabs(8).replace(' ', '&nbsp;')
lines = [doreplace(s) for s in payload.split('\n')]
payload = '<tt>\n' + BR.join(lines) + '\n</tt>\n'
part.set_payload(payload)