------------------------------------------------------------
revno: 1182
committer: Mark Sapiro <[email protected]>
branch nick: 2.1
timestamp: Fri 2009-07-31 15:37:29 -0700
message:
  Backported several bug fixes from the 2.2 branch.
modified:
  Mailman/Cgi/admin.py
  Mailman/Cgi/listinfo.py
  Mailman/Handlers/MimeDel.py
  Mailman/Handlers/Scrubber.py
  Mailman/Pending.py
  Mailman/Utils.py
  NEWS
  bin/update


--
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/admin.py'
--- Mailman/Cgi/admin.py	2009-01-11 16:06:13 +0000
+++ Mailman/Cgi/admin.py	2009-07-31 22:37:29 +0000
@@ -232,7 +232,7 @@
         mlist = MailList.MailList(name, lock=0)
         if mlist.advertised:
             if mm_cfg.VIRTUAL_HOST_OVERVIEW and \
-                   mlist.web_page_url.find(hostname) == -1:
+                   mlist.web_page_url.find('/%s/' % hostname) == -1:
                 # List is for different identity of this host - skip it.
                 continue
             else:

=== modified file 'Mailman/Cgi/listinfo.py'
--- Mailman/Cgi/listinfo.py	2005-08-27 01:40:17 +0000
+++ Mailman/Cgi/listinfo.py	2009-07-31 22:37:29 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2003 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-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
@@ -12,7 +12,8 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+# USA.
 
 """Produce listinfo page, primary web entry-point to mailing lists.
 """
@@ -87,7 +88,7 @@
         mlist = MailList.MailList(name, lock=0)
         if mlist.advertised:
             if mm_cfg.VIRTUAL_HOST_OVERVIEW and \
-                   mlist.web_page_url.find(hostname) == -1:
+                   mlist.web_page_url.find('/%s/' % hostname) == -1:
                 # List is for different identity of this host - skip it.
                 continue
             else:

=== modified file 'Mailman/Handlers/MimeDel.py'
--- Mailman/Handlers/MimeDel.py	2007-10-05 02:52:04 +0000
+++ Mailman/Handlers/MimeDel.py	2009-07-31 22:37:29 +0000
@@ -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 @@
             try:
                 firstalt = subpart.get_payload(0)
                 newpayload.append(firstalt)
-            except IndexError:
+            except (IndexError, TypeError):
                 pass
         else:
             newpayload.append(subpart)

=== modified file 'Mailman/Handlers/Scrubber.py'
--- Mailman/Handlers/Scrubber.py	2009-01-13 18:53:19 +0000
+++ Mailman/Handlers/Scrubber.py	2009-07-31 22:37:29 +0000
@@ -262,7 +262,7 @@
                 # 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)

=== modified file 'Mailman/Pending.py'
--- Mailman/Pending.py	2008-11-13 04:02:29 +0000
+++ Mailman/Pending.py	2009-07-31 22:37:29 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2008 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-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
@@ -12,7 +12,8 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+# USA.
 
 """Track pending actions which require confirmation."""
 
@@ -23,6 +24,7 @@
 import cPickle
 
 from Mailman import mm_cfg
+from Mailman import UserDesc
 from Mailman.Utils import sha_new
 
 # Types of pending records
@@ -174,9 +176,15 @@
         # know that the only things that were kept in the old format were
         # subscription requests.  Also, the old request format didn't have the
         # subscription language.  Best we can do here is use the server
-        # default.
-        db[cookie] = (SUBSCRIPTION,) + data[:-1] + \
-                     (mm_cfg.DEFAULT_SERVER_LANGUAGE,)
+        # default.  We also need a fullname because confirmation processing
+        # references all those UserDesc attributes.
+        ud = UserDesc.UserDesc(address=data[0],
+                               fullname='',
+                               password=data[1],
+                               digest=data[2],
+                               lang=mm_cfg.DEFAULT_SERVER_LANGUAGE,
+                               )
+        db[cookie] = (SUBSCRIPTION, ud)
         # The old database format kept the timestamp as the time the request
         # was made.  The new format keeps it as the time the request should be
         # evicted.

=== modified file 'Mailman/Utils.py'
--- Mailman/Utils.py	2009-01-03 02:40:28 +0000
+++ Mailman/Utils.py	2009-07-31 22:37:29 +0000
@@ -808,12 +808,25 @@
     newparts = []
     parts = re.split(r'&(?P<ref>[^;]+);', s)
     def appchr(i):
-        if i < 256:
-            newparts.append(chr(i))
+        # do everything in unicode
+        newparts.append(unichr(i))
+    def tounicode(s):
+        # We want the default fallback to be iso-8859-1 even if the language
+        # is English (us-ascii).  This seems like a practical compromise so
+        # that non-ASCII characters in names can be used in English lists w/o
+        # having to change the global charset for English from us-ascii (which
+        # I superstitiously think may have unintended consequences).
+        if isinstance(s, unicode):
+            return s
+        if lang is None:
+            charset = 'iso-8859-1'
         else:
-            newparts.append(unichr(i))
+            charset = GetCharSet(lang)
+            if charset == 'us-ascii':
+                charset = 'iso-8859-1'
+        return unicode(s, charset, 'replace')
     while True:
-        newparts.append(parts.pop(0))
+        newparts.append(tounicode(parts.pop(0)))
         if not parts:
             break
         ref = parts.pop(0)
@@ -822,28 +835,16 @@
                 appchr(int(ref[1:]))
             except ValueError:
                 # Non-convertable, stick with what we got
-                newparts.append('&'+ref+';')
+                newparts.append(tounicode('&'+ref+';'))
         else:
             c = htmlentitydefs.entitydefs.get(ref, '?')
             if c.startswith('#') and c.endswith(';'):
                 appchr(int(ref[1:-1]))
             else:
-                newparts.append(c)
+                newparts.append(tounicode(c))
     newstr = EMPTYSTRING.join(newparts)
-    if isinstance(newstr, UnicodeType):
-        return newstr
-    # We want the default fallback to be iso-8859-1 even if the language is
-    # English (us-ascii).  This seems like a practical compromise so that
-    # non-ASCII characters in names can be used in English lists w/o having to
-    # change the global charset for English from us-ascii (which I
-    # superstitiously think may have unintended consequences).
-    if lang is None:
-        charset = 'iso-8859-1'
-    else:
-        charset = GetCharSet(lang)
-        if charset == 'us-ascii':
-            charset = 'iso-8859-1'
-    return unicode(newstr, charset, 'replace')
+    # newstr is unicode
+    return newstr
 
 
 # The opposite of canonstr() -- sorta.  I.e. it attempts to encode s in the

=== modified file 'NEWS'
--- NEWS	2009-07-31 20:27:06 +0000
+++ NEWS	2009-07-31 22:37:29 +0000
@@ -8,6 +8,27 @@
 
   Bug Fixes and other patches
 
+    - Scrubbed HTML attachments containing tab characters would get the tabs
+      replaced by a string of '&nbsp' without a semicolon.  Fixed.
+
+    - Caught a TypeError in content filtering, collapse alternatives that
+      occurred with a malformed message if a multipart/alternative part
+      wasn't multi-part.  Reported in comments to bug #266230.
+
+    - Fixed a few things in bin/update:
+      - Changed some old messages for more current meaning.
+      - Fixed qfiles update to not lose metadata from 2.1.5+ format entries.
+      - Fixed 2.0.x template migration to not die if the templates/ tree
+        contains subdirectories from a version control system.
+
+    - Fixed a bug that would show a list on the admin and listinfo overview
+      pages if its web_page_url host contained the current host as a
+      substring.  Bug #342162.
+
+    - Fixed a bug in Utils.canonstr() that would throw a UnicodeDecodeError
+      if the string contained an HTML entity > 255 and also characters in the
+      128-255 range.  Bug #341594.
+
     - Added recognition for more bounces.
 
     - Updated contrib/mmdsr to report preserved messages.

=== modified file 'bin/update'
--- bin/update	2008-11-13 04:02:29 +0000
+++ bin/update	2009-07-31 22:37:29 +0000
@@ -1,6 +1,6 @@
 #! @PYTHON@
 #
-# Copyright (C) 1998-2008 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-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
@@ -14,7 +14,8 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+# USA.
 
 """Perform all necessary upgrades.
 
@@ -126,8 +127,8 @@
         try:
             fp = open(os.path.join(mm_cfg.TEMPLATE_DIR, gtemplate))
         except IOError, e:
-            if e.errno <> errno.ENOENT: raise
-            # No global template
+            if e.errno not in (errno.ENOENT, errno.EISDIR): raise
+            # No global template or maybe a VCS directory
             continue
 
         gcksum = Utils.md5_new(fp.read()).digest()
@@ -298,9 +299,7 @@
         %(newname)s""")
         else:
             # directory
-            print _("""\
-    looks like you have a really recent CVS installation...
-    you're either one brave soul, or you already ran me""")
+            print _('Nothing to do.')
 
 
     #
@@ -321,9 +320,7 @@
     to
         %(newname)s""")
         else: # directory
-            print _("""\
-    looks like you have a really recent CVS installation...
-    you're either one brave soul, or you already ran me""")
+            print _('Nothing to do.')
 
     #
     # move the html archives there
@@ -510,6 +507,12 @@
         try:
             msgfp = open(pckfile)
             msg = cPickle.load(msgfp)
+            if not data:
+                # There was no .db file. Is this a post 2.1.5 .pck?
+                try:
+                    data = cPickle.load(msgfp)
+                except EOFError:
+                    pass
             os.unlink(pckfile)
         except EnvironmentError, e:
             if e.errno <> errno.ENOENT: raise

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

Reply via email to