From aa5b411b41978f3835c49850dd567fc284d9aad5 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 11 May 2008 20:51:18 +0000 Subject: [PATCH] #756982: Remove rfc822 reference. --- Doc/library/mailbox.rst | 7 ++----- Lib/mailbox.py | 3 +-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Doc/library/mailbox.rst b/Doc/library/mailbox.rst index 6db68ee2fcd..e437b7a5d0d 100644 --- a/Doc/library/mailbox.rst +++ b/Doc/library/mailbox.rst @@ -277,7 +277,7 @@ Maildir, mbox, MH, Babyl, and MMDF. ^^^^^^^^^^^^^^^^ -.. class:: Maildir(dirname[, factory=rfc822.Message[, create=True]]) +.. class:: Maildir(dirname[, factory=None[, create=True]]) A subclass of :class:`Mailbox` for mailboxes in Maildir format. Parameter *factory* is a callable object that accepts a file-like message representation @@ -286,10 +286,7 @@ Maildir, mbox, MH, Babyl, and MMDF. representation. If *create* is ``True``, the mailbox is created if it does not exist. - It is for historical reasons that *factory* defaults to :class:`rfc822.Message` - and that *dirname* is named as such rather than *path*. For a :class:`Maildir` - instance that behaves like instances of other :class:`Mailbox` subclasses, set - *factory* to ``None``. + It is for historical reasons that *dirname* is named as such rather than *path*. Maildir is a directory-based mailbox format invented for the qmail mail transfer agent and now widely supported by other programs. Messages in a diff --git a/Lib/mailbox.py b/Lib/mailbox.py index 595f986fd9a..38ff0b1eb74 100755 --- a/Lib/mailbox.py +++ b/Lib/mailbox.py @@ -18,7 +18,6 @@ import copy import email import email.message import email.generator -import rfc822 import io try: if sys.platform == 'os2emx': @@ -222,7 +221,7 @@ class Maildir(Mailbox): colon = ':' - def __init__(self, dirname, factory=rfc822.Message, create=True): + def __init__(self, dirname, factory=None, create=True): """Initialize a Maildir instance.""" Mailbox.__init__(self, dirname, factory, create) if not os.path.exists(self._path):