Skip to content

mailbox.Maildir should ignore files named with a leading dot #65559

Closed

Description

@liw
mannequin
BPO 21360
Nosy @warsaw, @bitdancer, @maxking, @ZackerySpytz
PRs
  • bpo-21360: mailbox.Maildir now ignores files with a leading dot #11833
  • 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 2014-04-26.22:06:43.614>
    labels = ['3.7', '3.8', 'type-bug', 'library', 'expert-email']
    title = 'mailbox.Maildir should ignore files named with a leading dot'
    updated_at = <Date 2019-10-06.19:49:27.458>
    user = 'https://bugs.python.org/liw'

    bugs.python.org fields:

    activity = <Date 2019-10-06.19:49:27.458>
    actor = 'maxking'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)', 'email']
    creation = <Date 2014-04-26.22:06:43.614>
    creator = 'liw'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 21360
    keywords = ['patch']
    message_count = 4.0
    messages = ['217221', '218557', '335375', '354046']
    nosy_count = 7.0
    nosy_names = ['barry', 'r.david.murray', 'liw', 'mdengler', 'Vincentdavis', 'maxking', 'ZackerySpytz']
    pr_nums = ['11833']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue21360'
    versions = ['Python 2.7', 'Python 3.7', 'Python 3.8']

    Activity

    1. liw commented on Apr 26, 2014

      liwmannequin
      MannequinAuthor

      The maildir format specification
      (see http://cr.yp.to/proto/maildir.html) is clear that files named with leading dots should be ignore:

      Unless you're writing messages to a maildir, the format of a unique
      name is none of your business. A unique name can be anything that
      doesn't contain a colon (or slash) and doesn't start with a dot. Do not
      try to extract information from unique names.

      Test case:

      liw@havelock$ find Maildir -ls
      8921206 4 drwxrwxr-x 5 liw liw 4096 Apr 26 23:03 Maildir
      8921207 4 drwxrwxr-x 2 liw liw 4096 Apr 26 23:03 Maildir/cur
      8921209 4 drwxrwxr-x 2 liw liw 4096 Apr 26 23:03 Maildir/tmp
      8921208 4 drwxrwxr-x 2 liw liw 4096 Apr 26 23:03 Maildir/new
      8913523 0 -rw-rw-r-- 1 liw liw 0 Apr 26 23:03 Maildir/new/.foo
      liw@havelock$ python -c 'import mailbox
      maildir = mailbox.Maildir("Maildir")
      print maildir.keys()
      '
      ['.foo']
      liw@havelock$

      The correct output would be the empty list.

      "mutt -f Maildir" correctly shows now messages in that folder.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      on Apr 26, 2014
    3. bitdancer commented on May 14, 2014

      @bitdancer
      Member

      I wonder if changing this would break any working programs. I'd like to think not, but it is certainly possible for someone to be actually depending this bug.

    4. ZackerySpytz commented on Feb 12, 2019

      ZackerySpytzmannequin
      Mannequin

      I've created a PR for this issue.

    5. maxking commented on Oct 6, 2019

      @maxking
      Contributor

      David: How do you propose we move forward on this?

      Should we provide a switch to keep the original behaviour (which is off by default) so if there is someone depending on this bug, they could still continue to do it with relatively small change?

      It is a change of behaviour, so probably isn't going to be back ported if it gets merged in 3.9 window.

    6. transferred this issue fromon Apr 10, 2022
    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

      3.7 (EOL)end of life3.8 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytopic-emailtype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions