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.
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. :)
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:27
admin
set
github: 45618
2008-01-19 20:15:02
akuchling
set
status: open -> closedresolution: fixedmessages: +