msg16521 - (view) |
Author: Ben Leslie (benno37) |
Date: 2003-06-19 02:19 |
The mailbox module uses the rfc822 module as its default factory for creating message objects. The rfc822 documentation claims that its use is deprecated. The mailbox module should probably use the new email module as its default factory. Of course this has backward compatibility issues, in which case it should at least be mentioned in the mailbox documentation that it uses the deprecated rfc822 module, and provide an example of how to use the email module instead. |
|
|
msg16522 - (view) |
Author: Barry A. Warsaw (barry) *  |
Date: 2003-06-20 21:48 |
Logged In: YES user_id=12800 I've added some sample code to the mailbox documentation that explain how to use the email package with the mailbox module. We can't change the default for backward compatibility reasons, as you point out. |
|
|
msg16523 - (view) |
Author: Johannes Gijsbers (jlgijsbers) *  |
Date: 2005-01-08 14:22 |
Logged In: YES user_id=469548 So, with the plans to seriously start working deprecating rfc822, should we use the email module as the default factory now? |
|
|
msg16524 - (view) |
Author: Barry A. Warsaw (barry) *  |
Date: 2005-01-08 15:49 |
Logged In: YES user_id=12800 It's a good question. I'd like to say yes so that we can start adding deprecation warnings to rfc822 for Python 2.5. |
|
|
msg16525 - (view) |
Author: Anthony Baxter (anthonybaxter)  |
Date: 2005-01-10 07:56 |
Logged In: YES user_id=29957 Given the amount of code out there using rfc822, should we instead PDW it? In any case, I'm -0 on putting a DeprecationWarning on it unless we've removed all use of it from the stdlib. |
|
|
msg16526 - (view) |
Author: A.M. Kuchling (akuchling) *  |
Date: 2007-01-05 14:46 |
The reworking of mailbox.py introduced in Python 2.5 adds new mailbox classes that do use email.Message. Arguably we could begin deprecating the old classes (or just remove them all for Python 3000?). |
|
|
msg57867 - (view) |
Author: synx (synx) |
Date: 2007-11-27 09:49 |
I dunno if this is helpful, but in the 2.5 module, it parses mailboxes into rfc822 messages, but then expects them to be email.Message messages when unparsing them back to a mailbox. mbox2.add(mbox1.popitem()[1]) fails with rfc822 as the default factory. Since the "factory" is the only thing still using rfc822, it's easy to remove the use of rfc822 from this module entirely, which also eliminates the parsing/unparsing disconnect. |
|
|
msg66587 - (view) |
Author: Humberto Diógenes (hdiogenes) * |
Date: 2008-05-10 21:14 |
synx's patch wasn't applying cleanly and broke 2 maildir tests. I'm posting one with updated tests and documentation. Still need to get rid of rfc822 in test_mailbox, though. Question: mailbox.py has one section marked as "classes from the original module (for backward compatibility)". Shouldn't these be removed in py3k? |
|
|
msg66590 - (view) |
Author: A.M. Kuchling (akuchling) *  |
Date: 2008-05-10 22:19 |
I think removing those old classes in 3.0 would be very sensible. |
|
|
msg66598 - (view) |
Author: Humberto Diógenes (hdiogenes) * |
Date: 2008-05-11 03:07 |
I created issue 2814 with a patch to remove those old classes. |
|
|
msg66614 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2008-05-11 09:02 |
I removed the old classes in 3k. There remains one usage of rfc822, as the default "factory" of Maildir. It's replaced by None in the patch here; is that safe to do? |
|
|
msg66656 - (view) |
Author: Humberto Diógenes (hdiogenes) * |
Date: 2008-05-11 19:40 |
> rfc822 is replaced by None in the patch here; is that safe to do? Yes. That's what mailbox documentation says: Parameter factory is a callable object that accepts a file-like message representation [...] and returns a custom representation. If factory is None, MaildirMessage is used as the default message representation. |
|
|
msg66667 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2008-05-11 20:51 |
Removed the last rfc822 reference from 3k's mailbox.py in r63091. |
|
|
msg66672 - (view) |
Author: Humberto Diógenes (hdiogenes) * |
Date: 2008-05-11 21:22 |
Georg, any special reason for not removing rfc822 references from test_mailbox? That section of the patch was not merged. |
|
|
msg66673 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2008-05-11 21:31 |
Okay, removed that too in r63096. |
|
|