digest threshold calculation broken
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/
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.
-
_ = 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_
# This is a bit of a kludge to get the mbox
file moved to the digest
[http://
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.