Skip to content

mailbox: Implement >From_ decoding on input from mbox #73239

Open

Description

@bpoaugust
mannequin
BPO 29053
Nosy @warsaw, @bitdancer
Files
  • mboxo_patch.py
  • 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 = None
    closed_at = None
    created_at = <Date 2016-12-23.14:16:48.385>
    labels = ['type-feature', 'expert-email']
    title = 'mailbox: Implement >From_ decoding on input from mbox'
    updated_at = <Date 2017-01-03.12:21:51.618>
    user = 'https://bugs.python.org/bpoaugust'

    bugs.python.org fields:

    activity = <Date 2017-01-03.12:21:51.618>
    actor = 'vstinner'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['email']
    creation = <Date 2016-12-23.14:16:48.385>
    creator = 'bpoaugust'
    dependencies = []
    files = ['46017']
    hgrepos = []
    issue_num = 29053
    keywords = []
    message_count = 5.0
    messages = ['283879', '283882', '283883', '283914', '284500']
    nosy_count = 3.0
    nosy_names = ['barry', 'r.david.murray', 'bpoaugust']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'needs patch'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue29053'
    versions = ['Python 3.5']

    Activity

    1. bpoaugust commented on Dec 23, 2016

      bpoaugustmannequin
      MannequinAuthor

      The email package implements mboxo From_ mangling on output by default.

      However there is no provision to unmangle >From_ on input.

      This means that it's not possible to import mboxo files correctly.

    2. bpoaugust commented on Dec 23, 2016

      bpoaugustmannequin
      MannequinAuthor

      Is there any way to override the current behaviour?

    3. bitdancer commented on Dec 23, 2016

      @bitdancer
      Member

      Not easily. Making the feedparser more pluggable is on my wish list, but at this point someone would have to fund me for work on the email package before I'd be able to even clear the backlog to think about it :)

      I'd say accepting this as a new feature is a no-brainer, if you want to work on a patch. Make enabling it a Policy option that defaults to the current behavior.

    4. added
      type-featureA feature request or enhancement
      and removed
      type-bugAn unexpected behavior, bug, or error
      on Dec 23, 2016
    5. bpoaugust commented on Dec 24, 2016

      bpoaugustmannequin
      MannequinAuthor

      Attached please find patch which works for me.

      To use it independently of email, do something like:

      messages = mailbox.mbox(filename, MboxoFactory)

      where:

      class MboxoFactory(mailbox.mboxMessage):
          def __init__(self, message=None):
              super().__init__(message=MboxoReader(message))

      HTH

    6. bpoaugust commented on Jan 2, 2017

      bpoaugustmannequin
      MannequinAuthor

      The patch can be simplified by just looking for b'\n' in the last 6 chars, and caching from b'\n' if found.

      This would mean more file seeking in exchange for less buffer matching.

    7. changed the title [-]Implement >From_ decoding on input from mbox[/-] [+]mailbox: Implement >From_ decoding on input from mbox[/+] on Jan 3, 2017
    8. transferred this issue fromon Apr 10, 2022
    9. added
      stdlibStandard Library Python modules in the Lib/ directory
      on Nov 23, 2023
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      stdlibStandard Library Python modules in the Lib/ directorytopic-emailtype-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions