Skip to content

Add Maildir.get_flags() to access message flags without opening the file #90890

Description

@gildea
mannequin
BPO 46734
Nosy @gildea
PRs
  • gh-90890: Add method mailbox.Maildir.get_flags #31302
  • 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 2022-02-12.22:21:50.052>
    labels = ['type-feature', 'library', '3.11']
    title = 'Add Maildir.get_flags() to access message flags without opening the file'
    updated_at = <Date 2022-02-12.22:49:37.459>
    user = 'https://github.com/gildea'

    bugs.python.org fields:

    activity = <Date 2022-02-12.22:49:37.459>
    actor = 'gildea'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2022-02-12.22:21:50.052>
    creator = 'gildea'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46734
    keywords = ['patch']
    message_count = 1.0
    messages = ['413145']
    nosy_count = 1.0
    nosy_names = ['gildea']
    pr_nums = ['31302']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue46734'
    versions = ['Python 3.11']

    Linked PRs

    Activity

    1. gildea commented on Feb 12, 2022

      gildeamannequin
      MannequinAuthor

      A message's flags are stored in its filename by Maildir, so the flags
      are available without reading the message file itself. The structured
      message file name makes it efficient to scan a large mailbox to select
      only messages that are, for example, not Trashed.

      The mailbox.Maildir interface does not expose these flags, however. The
      only way to access the flags through the mailbox library is to create a
      mailbox.MaildirMessage object, which has a get_flags() method. But
      creating a MaildirMessage requires opening the message file, which is slow.

      I propose adding a parallel get_flags(key) method to mailbox.Maildir,
      so that the flags are available without having to create a
      MaildirMessage object.

      In iterating through a mailbox with thousands of messages, I find that
      this proposed Maildir.get_flags() method is 50 times faster than
      MaildirMessage.get_flags().

    2. added
      3.11only security fixes
      stdlibStandard Library Python modules in the Lib/ directory
      type-featureA feature request or enhancement
      on Feb 12, 2022
    3. transferred this issue fromon Apr 10, 2022
    4. gildea commented on Apr 14, 2023

      @gildea
      ContributorAuthor

      Ping. This issue has a patch that needs reviewing

    5. added a commit that references this issue on Apr 26, 2023
    6. gildea commented on May 25, 2023

      @gildea
      ContributorAuthor

      I have updated the patch based on initial review. Please take another look.

    7. added
      3.13only security fixes
      and removed
      3.11only security fixes
      on May 25, 2023
    8. gildea commented on Aug 17, 2023

      @gildea
      ContributorAuthor

      Ping. This issue has a patch that needs reviewing

    9. self-assigned this
      on Nov 11, 2023
    10. added a commit that references this issue on Nov 11, 2023
    11. gpshead commented on Nov 11, 2023

      @gpshead
      Member

      Thanks!

    12. added a commit that references this issue on Dec 14, 2023
    13. added a commit that references this issue on Dec 15, 2023
    14. added 2 commits that reference this issue on Feb 11, 2024
    15. added 2 commits that reference this issue on Sep 2, 2024
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    3.13only security fixesstdlibStandard 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