[Python-bugs-list] [Bug #117490] mailbox.Maildir does not create self.boxes in __init__

noreply@sourceforge.net noreply@sourceforge.net
Mon, 23 Oct 2000 06:38:04 -0700


Bug #117490, was updated on 2000-Oct-23 05:31
Here is a current snapshot of the bug.

Project: Python
Category: Library
Status: Closed
Resolution: Fixed
Bug Group: None
Priority: 8
Summary: mailbox.Maildir does not create self.boxes in __init__

Details: The __init__ method of the Maildir class sets "boxes", not
"self.boxes". This means that attempts to manipulate that list fail,
and such mailboxes are always empty.

Here's the patch.

su-2.04# p4 diff2 -du mailbox.py\#1 mailbox.py\#2
==== //depot/hosts/guru/usr/opt/lib/python2.0/mailbox.py#1 (xtext) - //depot/hosts/guru/usr/opt/lib/python2.0/mailbox.py#2 (xtext) ==== content
@@ -185,13 +185,13 @@
 
         # check for new mail
         newdir = os.path.join(self.dirname, 'new')
-        boxes = [os.path.join(newdir, f)
-                 for f in os.listdir(newdir) if f[0] != '.']
+        self.boxes = [os.path.join(newdir, f)
+                      for f in os.listdir(newdir) if f[0] != '.']
 
         # Now check for current mail in this maildir
         curdir = os.path.join(self.dirname, 'cur')
-        boxes += [os.path.join(curdir, f)
-                  for f in os.listdir(curdir) if f[0] != '.']
+        self.boxes += [os.path.join(curdir, f)
+                       for f in os.listdir(curdir) if f[0] != '.']
 
     def next(self):
         if not self.boxes:



Follow-Ups:

Date: 2000-Oct-23 06:38
By: fdrake

Comment:
Fixed in Lib/mailbox.py revision 1.26; a test case will be added to the regression test suite as well.
-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=117490&group_id=5470