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: factory not used
Type: resource usage Stage:
Components: Extension Modules Versions: Python 2.6, Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, bwurst, gvanrossum
Priority: normal Keywords: patch

Created on 2007-10-14 16:02 by bwurst, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
python-mailbox.patch bwurst, 2007-10-15 18:08
Messages (4)
msg56418 - (view) Author: Bernd Wurst (bwurst) Date: 2007-10-14 16:02
The "factory"-argument to the constructorof mailbox.Maildir is not 
used as it should be.

First, it's default is set to rfc822.Message instead of MaildirMessage 
and then, inside the module's code, MaildirMessage is hard-coded as a 
message constructor.

If I need a derived class with custom attributes, I cannot use it.
msg56450 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-10-15 17:28
Patch please?
msg56458 - (view) Author: Bernd Wurst (bwurst) Date: 2007-10-15 18:08
Attached.
I am not a python hacker (by now). :) 
I wonder why the Message-declarations must be before their usage 
_inside_ the Maildir-class but it seems like. So the changeset is 
rather huge but the code changes are somewhat minimal. Just because 
the Message-classes must be at the beginning. Perhaps they should be 
outsourced. :)

I don't really have experience with that module, so I don't know if 
that patch has side-effects on older programs using this module. But 
as compatibility has been broken down (a bit) with the current 
version, it should not really matter. :)
msg60223 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2008-01-19 20:15
I think the required patch is much simpler; only get_message() needs to
be updated.  I've committed this change to trunk as rev60095, and to
release25-maint as rev. 60096.
History
Date User Action Args
2022-04-11 14:56:27adminsetgithub: 45618
2008-01-19 20:15:02akuchlingsetstatus: open -> closed
resolution: fixed
messages: + msg60223
2008-01-10 00:14:36christian.heimessetpriority: normal
keywords: + patch
versions: + Python 2.6
2008-01-09 21:28:20akuchlingsetassignee: akuchling
nosy: + akuchling
2007-10-15 18:08:01bwurstsetfiles: + python-mailbox.patch
messages: + msg56458
2007-10-15 17:28:07gvanrossumsetnosy: + gvanrossum
messages: + msg56450
2007-10-14 16:02:43bwurstcreate