tags 476806 + patch 
thanks

On Sat, Apr 19, 2008 at 04:38:05PM -0400, Joey Hess wrote:
> Julien Danjou wrote:
> > First of all, I'm making this bug serious since it breaks the software
> > for me, but feel free to downgrade.

Unless you feed multiple mailboxes to archivemail in one go, I don't see
how this breaks anything, apart from firing annoying warnings. 

I'm attaching the trivial fix from upstream.  Note that the problem has
been reported before, see issue #1878940 at sf.net[1].  

> The bug seems to be that under python 2.5, a mailbox.Maildir object that
> is empty evaluates to a false value, while in previous versions of python,
> the same object would evaluate to true:
<snip>
> I don't know enough python to say, but this looks rather like a bug or
> incompatible change in python 2.5.
> 
> If so, this kind of change in python would certianly seem likely to break
> lots of other stuff, so perhaps your severity isn't so inflated after all.

You are correct, the mailbox module has been rewritten in Python 2.5.
They have put most of the new code into new classes, keeping the old
classes around for backward compatiblity; but the Maildir class was
rewritten, and the boolean value of an empty maildir has changed to
False.  While this probably counts as a python bug, I don't know if it
qualifies as serious.

BTW, this is not the only breakage I've seen due to the new Maildir
class[2]. 

Nikolaus

[1]
http://sourceforge.net/tracker/index.php?func=detail&aid=1878940&group_id=49630&atid=456912
[2]
http://sourceforge.net/tracker/index.php?func=detail&aid=1670422&group_id=49630&atid=456910
Index: archivemail.py
===================================================================
--- archivemail.py	(revision 265)
+++ archivemail.py	(revision 266)
@@ -1287,7 +1287,6 @@
         original = mailbox.MHMailbox(mailbox_name)
     else:
         unexpected_error("unknown type: %s" % type)        
-    assert(original)
 
     cache = IdentityCache(mailbox_name)
 

Reply via email to