------------------------------------------------------------
revno: 1304
committer: Mark Sapiro <msap...@value.net>
branch nick: 2.1
timestamp: Tue 2011-05-10 18:57:55 -0700
message:
  Fixed a problem in admindb.py where the character set for the display of
  the message body excerpt was not correctly determined.  Bug #779751.
modified:
  Mailman/Cgi/admindb.py
  NEWS


--
lp:mailman/2.1
https://code.launchpad.net/~mailman-coders/mailman/2.1

Your team Mailman Checkins is subscribed to branch lp:mailman/2.1.
To unsubscribe from this branch go to 
https://code.launchpad.net/~mailman-coders/mailman/2.1/+edit-subscription
=== modified file 'Mailman/Cgi/admindb.py'
--- Mailman/Cgi/admindb.py	2011-04-24 00:49:15 +0000
+++ Mailman/Cgi/admindb.py	2011-05-11 01:57:55 +0000
@@ -631,7 +631,14 @@
     else:
         body = EMPTYSTRING.join(lines)
     # Get message charset and try encode in list charset
-    mcset = msg.get_param('charset', 'us-ascii').lower()
+    # We get it from the first text part.
+    for part in msg.walk():
+        if part.get_content_maintype() == 'text':
+            # Watchout for charset= with no value.
+            mcset = part.get_content_charset() or 'us-ascii'
+            break
+    else:
+        mcset = 'us-ascii'
     lcset = Utils.GetCharSet(mlist.preferred_language)
     if mcset <> lcset:
         try:

=== modified file 'NEWS'
--- NEWS	2011-05-10 01:34:07 +0000
+++ NEWS	2011-05-11 01:57:55 +0000
@@ -55,6 +55,9 @@
 
   Bug Fixes and other patches
 
+    - Fixed a problem in admindb.py where the character set for the display of
+      the message body excerpt was not correctly determined.  Bug #779751.
+
     - Prevented setting user passwords with leading/trailing whitespace.
       Bug #778088.
 

_______________________________________________
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to