digest threshold calculation broken

Bug #265552 reported by Dmick
2
Affects Status Importance Assigned to Milestone
GNU Mailman
Fix Released
Medium
Unassigned

Bug Description

Digest threshold is checked in ToDigest.py by using
tell() on the mboxfp, after Generator.write() has
been called. Apparently Generator.write() doesn't
leave the file at EOF, so the digest calculation
often fails.

Here's a fix:

Index: ToDigest.py
===================================================================
RCS file:
/cvsroot/mailman/mailman/Mailman/Handlers/ToDigest.py,v
retrieving revision 2.9
diff -u -r2.9 ToDigest.py
--- ToDigest.py 2001/07/27 17:33:27 2.9
+++ ToDigest.py 2001/09/27 02:36:43
@@ -45,7 +45,6 @@

 from Mailman.pythonlib import mailbox
 from Mailman.pythonlib.StringIO import StringIO
-
 _ = i18n._

@@ -77,6 +76,7 @@
     # us exactly how big the MIME, rfc1153, or any
other generated digest
     # message will be, but it's the most easily
available metric to decide
     # whether the size threshold has been reached.
+ mboxfp.seek(0, 2)
     size = mboxfp.tell()
     if size / 1024.0 >= mlist.digest_size_threshhold:
         # This is a bit of a kludge to get the mbox
file moved to the digest

[http://sourceforge.net/tracker/index.php?func=detail&aid=465477&group_id=103&atid=100103]

Revision history for this message
Barry Warsaw (barry) wrote :

Probably a better idea is to flush mboxfp and then use
os.path.getsize() on the filename to calculate the size.
I've changed the code to do this and it seems to work properly.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.