Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mailbox should use email not rfc822 #38679

Closed
benno37 mannequin opened this issue Jun 19, 2003 · 15 comments
Closed

mailbox should use email not rfc822 #38679

benno37 mannequin opened this issue Jun 19, 2003 · 15 comments
Assignees
Labels
docs Documentation in the Doc dir easy stdlib Python modules in the Lib dir

Comments

@benno37
Copy link
Mannequin

benno37 mannequin commented Jun 19, 2003

BPO 756982
Nosy @warsaw, @akuchling, @birkenfeld, @hdiogenes
Files
  • mailbox.py.patch
  • mailbox-replace_rfc822.patch: Same patch updated. Removes all references to rfc822 from mailbox and test_mailbox.
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/akuchling'
    closed_at = <Date 2008-05-11.20:51:33.906>
    created_at = <Date 2003-06-19.02:19:01.000>
    labels = ['easy', 'library', 'docs']
    title = 'mailbox should use email not rfc822'
    updated_at = <Date 2008-05-11.21:31:51.761>
    user = 'https://bugs.python.org/benno37'

    bugs.python.org fields:

    activity = <Date 2008-05-11.21:31:51.761>
    actor = 'georg.brandl'
    assignee = 'akuchling'
    closed = True
    closed_date = <Date 2008-05-11.20:51:33.906>
    closer = 'georg.brandl'
    components = ['Documentation', 'Library (Lib)']
    creation = <Date 2003-06-19.02:19:01.000>
    creator = 'benno37'
    dependencies = []
    files = ['8812', '10279']
    hgrepos = []
    issue_num = 756982
    keywords = ['patch', 'easy']
    message_count = 15.0
    messages = ['16521', '16522', '16523', '16524', '16525', '16526', '57867', '66587', '66590', '66598', '66614', '66656', '66667', '66672', '66673']
    nosy_count = 8.0
    nosy_names = ['barry', 'akuchling', 'anthonybaxter', 'georg.brandl', 'jlgijsbers', 'benno37', 'hdiogenes', 'synx']
    pr_nums = []
    priority = 'low'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue756982'
    versions = ['Python 2.6', 'Python 3.0']

    @benno37
    Copy link
    Mannequin Author

    benno37 mannequin commented Jun 19, 2003

    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.

    @benno37 benno37 mannequin assigned warsaw Jun 19, 2003
    @benno37 benno37 mannequin added the extension-modules C modules in the Modules dir label Jun 19, 2003
    @benno37 benno37 mannequin assigned warsaw Jun 19, 2003
    @benno37 benno37 mannequin added the extension-modules C modules in the Modules dir label Jun 19, 2003
    @warsaw
    Copy link
    Member

    warsaw commented Jun 20, 2003

    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.

    @jlgijsbers
    Copy link
    Mannequin

    jlgijsbers mannequin commented Jan 8, 2005

    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?

    @warsaw
    Copy link
    Member

    warsaw commented Jan 8, 2005

    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.

    @anthonybaxter
    Copy link
    Mannequin

    anthonybaxter mannequin commented Jan 10, 2005

    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.

    @akuchling
    Copy link
    Member

    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?).

    @synx
    Copy link
    Mannequin

    synx mannequin commented Nov 27, 2007

    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.

    @akuchling akuchling assigned akuchling and unassigned warsaw Jan 9, 2008
    @tiran tiran added easy docs Documentation in the Doc dir stdlib Python modules in the Lib dir and removed extension-modules C modules in the Modules dir labels Jan 20, 2008
    @hdiogenes
    Copy link
    Mannequin

    hdiogenes mannequin commented May 10, 2008

    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?

    @akuchling
    Copy link
    Member

    I think removing those old classes in 3.0 would be very sensible.

    @hdiogenes
    Copy link
    Mannequin

    hdiogenes mannequin commented May 11, 2008

    I created bpo-2814 with a patch to remove those old classes.

    @birkenfeld
    Copy link
    Member

    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?

    @hdiogenes
    Copy link
    Mannequin

    hdiogenes mannequin commented May 11, 2008

    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.

    @birkenfeld
    Copy link
    Member

    Removed the last rfc822 reference from 3k's mailbox.py in r63091.

    @hdiogenes
    Copy link
    Mannequin

    hdiogenes mannequin commented May 11, 2008

    Georg, any special reason for not removing rfc822 references from
    test_mailbox? That section of the patch was not merged.

    @birkenfeld
    Copy link
    Member

    Okay, removed that too in r63096.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    docs Documentation in the Doc dir easy stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants