aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Sapiro <msapiro@value.net>2011-12-31 14:22:39 -0800
committerMark Sapiro <msapiro@value.net>2011-12-31 14:22:39 -0800
commit3c1fe7bcb3c10650cd039c800aa1356886586873 (patch)
treecd410817905f6e251b26e303aab6e036cd12baeb
parenta6ff8e611b314b145add34b43c278944957d8d5e (diff)
downloadmailman2-3c1fe7bcb3c10650cd039c800aa1356886586873.tar.gz
mailman2-3c1fe7bcb3c10650cd039c800aa1356886586873.tar.xz
mailman2-3c1fe7bcb3c10650cd039c800aa1356886586873.zip
Fix for bug #629738 could cause a crash in the admindb details display
if the decoded message body contained characters not in the character set of the list's preferred language. Fixed. Bug #910440.
-rw-r--r--Mailman/Cgi/admindb.py4
-rw-r--r--NEWS4
2 files changed, 7 insertions, 1 deletions
diff --git a/Mailman/Cgi/admindb.py b/Mailman/Cgi/admindb.py
index 639f64cc..d1873321 100644
--- a/Mailman/Cgi/admindb.py
+++ b/Mailman/Cgi/admindb.py
@@ -632,6 +632,8 @@ def show_post_requests(mlist, id, info, total, count, form):
body = EMPTYSTRING.join(lines)
# Get message charset and try encode in list charset
# We get it from the first text part.
+ # We need to replace invalid characters here or we can throw an uncaught
+ # exception in doc.Format().
for part in msg.walk():
if part.get_content_maintype() == 'text':
# Watchout for charset= with no value.
@@ -642,7 +644,7 @@ def show_post_requests(mlist, id, info, total, count, form):
lcset = Utils.GetCharSet(mlist.preferred_language)
if mcset <> lcset:
try:
- body = unicode(body, mcset).encode(lcset)
+ body = unicode(body, mcset).encode(lcset, 'replace')
except (LookupError, UnicodeError, ValueError):
pass
hdrtxt = NL.join(['%s: %s' % (k, v) for k, v in msg.items()])
diff --git a/NEWS b/NEWS
index 26aca183..764a4c2d 100644
--- a/NEWS
+++ b/NEWS
@@ -73,6 +73,10 @@ Here is a history of user visible changes to Mailman.
Bug Fixes and other patches
+ - Fix for bug #629738 could cause a crash in the admindb details display
+ if the decoded message body contained characters not in the character
+ set of the list's preferred language. Fixed. Bug #910440.
+
- Added recognition for another Qmail bounce format.
- Fixed an erroneous seek in the Mailman.Mailbox.Mailbox.AppendMessage