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

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

Closed
birkenfeld opened this issue Jun 23, 2012 · 6 comments
Closed

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

birkenfeld opened this issue Jun 23, 2012 · 6 comments
Assignees
Labels
type-bug An unexpected behavior, bug, or error

Comments

@birkenfeld
Copy link
Member

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']

    @birkenfeld
    Copy link
    Member Author

    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.

    @birkenfeld birkenfeld added the type-bug An unexpected behavior, bug, or error label Jun 23, 2012
    @pitrou
    Copy link
    Member

    pitrou commented Jun 23, 2012

    Looks fine to me.

    @larryhastings
    Copy link
    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.)

    @birkenfeld
    Copy link
    Member Author

    Works for me.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jun 23, 2012

    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

    @larryhastings
    Copy link
    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!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants