This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: mailbox.Maildir.get_folder() loses factory information
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, doko
Priority: normal Keywords:

Created on 2006-10-03 08:16 by doko, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
mailbox.patch akuchling, 2006-11-09 13:34 Patch fixing mailbox.py bug
Messages (2)
msg30139 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2006-10-03 08:16
[forwarded from http://bugs.debian.org/384512]

the factory defines what class the mails have that are
returned.

So for two nested folders a and a.b, the following code
will return
messages with two different classes:

# factory = None to get mailbox.MaildirMessage objects
md = mailbox.Maildir("a", factory=None)
print md["somemessage"].__class__
# will print mailbox.MaildirMessage
md2 = md.get_folder("b")
print md2["someothermessage"].__class__
# will print rfc822.Message

i.e. the factory= parameter passed to the outer Maildir
class upon
creation is not passed on to the subfolder creation in
get_folder()
msg30140 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2006-11-09 13:34
Logged In: YES 
user_id=11375

Committed to trunk in rev. 52690 and to 25-maint in rev.
52691.  Thanks for the bug report!  The MH class has the
same bug, so I fixed that too.

I've also attached the patch.  If you wish you can
incorporate the fix in Debian's patchset, or
wait for Python 2.5.1.

History
Date User Action Args
2022-04-11 14:56:20adminsetgithub: 44072
2006-10-03 08:16:24dokocreate