Skip to content

remove "rmdir" argument from os.unlink, add "dir_fd" to os.rmdir #59359

Closed

Description

@birkenfeld
BPO 15154
Nosy @birkenfeld, @pitrou, @larryhastings, @hynek
Files
  • move-dirfd-to-rmdir.patch
  • 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/larryhastings'
    closed_at = <Date 2012-06-23.23:58:06.533>
    created_at = <Date 2012-06-23.17:15:10.495>
    labels = ['type-bug']
    title = 'remove "rmdir" argument from os.unlink, add "dir_fd" to os.rmdir'
    updated_at = <Date 2012-06-23.23:58:06.532>
    user = 'https://github.com/birkenfeld'

    bugs.python.org fields:

    activity = <Date 2012-06-23.23:58:06.532>
    actor = 'larry'
    assignee = 'larry'
    closed = True
    closed_date = <Date 2012-06-23.23:58:06.533>
    closer = 'larry'
    components = []
    creation = <Date 2012-06-23.17:15:10.495>
    creator = 'georg.brandl'
    dependencies = []
    files = ['26111']
    hgrepos = []
    issue_num = 15154
    keywords = ['patch']
    message_count = 6.0
    messages = ['163647', '163650', '163662', '163668', '163694', '163695']
    nosy_count = 6.0
    nosy_names = ['georg.brandl', 'pitrou', 'larry', 'Arfrever', 'python-dev', 'hynek']
    pr_nums = []
    priority = 'critical'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue15154'
    versions = ['Python 3.3']

    Activity

    1. birkenfeld commented on Jun 23, 2012

      @birkenfeld
      MemberAuthor

      As Antoine noted in bpo-14626, the "rmdir" argument to os.unlink doesn't really make sense since we already deviate from just mapping posix functionality one-on-one.

      Attached is a patch removing "rmdir" from os.unlink, and instead adding "dir_fd" to os.rmdir.

    2. pitrou commented on Jun 23, 2012

      @pitrou
      Member

      Looks fine to me.

    3. larryhastings commented on Jun 23, 2012

      @larryhastings
      Contributor

      I think it's a good idea, and I didn't spot anything on my first pass at reviewing the patch. But I'm on my way out the door and won't be back for a few hours.

      Tell you what: once I'm back, if I don't spot anything out of place, I'll just check it in. If I have feedback I'll file a second patch. Work for you, Georg?

      (p.s. Antoine, Georg, anybody, if you have any more bright ideas like this, I'd love to hear 'em. But... now's the time.)

    4. birkenfeld commented on Jun 23, 2012

      @birkenfeld
      MemberAuthor

      Works for me.

    5. python-dev commented on Jun 23, 2012

      python-devmannequin
      Mannequin

      New changeset 3b7230997425 by Larry Hastings in branch 'default':
      Issue bpo-15154: Add "dir_fd" parameter to os.rmdir, remove "rmdir"
      http://hg.python.org/cpython/rev/3b7230997425

    6. larryhastings commented on Jun 23, 2012

      @larryhastings
      Contributor

      I made two documentation changes to the patch before committing it:

      • I restored the text under os.remove about how it doesn't handle
        directories.
      • I added a Misc/NEWS entry.

      But I didn't have to touch the code--that looked dead-on to me. Proper job, Georg!

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

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions