[Mailman-Developers] Problem with checkdbs script in Beta 4

Greg Ward gward@python.net
Wed Oct 30 18:08:37 2002


On 29 October 2002, Miller Brett said:
> I just upgraded to Mailman beta 4 from beta 3 and I am receiving this
> error when a mailman cron job runs. Has anyone seen this error and does
> anyone know how to fix it. This checkdbs script seemed to work fine in
> beta 3 but not beta 4.

Silly bug in 2.1b4, fixed in CVS.  You could either upgrade to the CVS
version, or apply this patch (which I just pulled out of CVS):

--- checkdbs	25 Oct 2002 19:06:33 -0000	2.14
+++ checkdbs	28 Oct 2002 03:43:42 -0000	2.17
@@ -6,14 +6,14 @@
 # modify it under the terms of the GNU General Public License
 # as published by the Free Software Foundation; either version 2
 # of the License, or (at your option) any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software 
+# along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 """Invoked by cron, this checks for pending moderation requests and mails the
@@ -23,12 +23,12 @@
 import sys
 import time
 from types import UnicodeType
-from email.Charset import Charset
 
 import paths
-# mm_cfg must be imported before the other modules, due to the side-effect of
-# it hacking sys.paths to include site-packages.  Without this, running this
-# script from cron with python -S will fail.
+
+# Import this after paths so we get Mailman's copy of the email package
+from email.Charset import Charset
+
 from Mailman import mm_cfg
 from Mailman import Utils
 from Mailman import MailList
@@ -52,7 +52,7 @@
 def main():
     for name in Utils.list_names():
         # the list must be locked in order to open the requests database
-	mlist = MailList.MailList(name)
+        mlist = MailList.MailList(name)
         try:
             count = mlist.NumRequestsPending()
             # While we're at it, let's evict yesterday's autoresponse data
@@ -87,8 +87,8 @@
                 msg.send(mlist, **{'tomoderators': 1})
         finally:
             mlist.Unlock()
-            
-            
+
+
 
 
 def pending_requests(mlist):
@@ -111,8 +111,10 @@
         info = mlist.GetRecord(id)
         when, sender, subject, reason, text, msgdata = mlist.GetRecord(id)
         date = time.ctime(when)
-        pending.append(_(
-            '     From: %(sender)s on %(date)s\n    Cause: %(reason)s'))
+        pending.append(_("""\
+From: %(sender)s on %(date)s
+Subject: %(subject)s
+Cause: %(reason)s"""))
         pending.append('')
     # Make sure that the text we return from here can be encoded to a byte
     # string in the charset of the list's language.  This could fail if for


-- 
Greg Ward <gward@python.net>                         http://www.gerg.ca/
Shape shifting reptilians are about to achieve complete control over
this planet!