GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — shutil.chown should support dir_fd and follow_symlinks keyword arguments · Issue #62308 · python/cpython

shutil.chown should support dir_fd and follow_symlinks keyword arguments #62308

New issue
Copy link
New issue
Copy link
Closed
Closed
shutil.chown should support dir_fd and follow_symlinks keyword arguments#62308
Copy link
Labels
easystdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

Description

cjwatson
mannequin
opened on May 31, 2013
Issue body actions
BPO 18108
Nosy @cjwatson, @PCManticore, @berkerpeksag, @hynek, @phmc, @avinassh, @tahia-khan
PRs
  • bpo-18108: Adding dir_fd and follow_symlinks keyword args to shutil.chown #15811
  • Files
  • issue18108.diff
  • 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 2013-05-31.13:09:57.018>
    labels = ['easy', 'type-feature', 'library']
    title = 'shutil.chown should support dir_fd and follow_symlinks keyword arguments'
    updated_at = <Date 2019-10-28.20:48:21.699>
    user = 'https://github.com/cjwatson'

    bugs.python.org fields:

    activity = <Date 2019-10-28.20:48:21.699>
    actor = 'pconnell'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2013-05-31.13:09:57.018>
    creator = 'cjwatson'
    dependencies = []
    files = ['35633']
    hgrepos = []
    issue_num = 18108
    keywords = ['patch', 'easy']
    message_count = 7.0
    messages = ['190404', '220430', '220564', '220565', '221675', '346893', '351543']
    nosy_count = 7.0
    nosy_names = ['cjwatson', 'Claudiu.Popa', 'berker.peksag', 'hynek', 'pconnell', 'avi', 'ta1hia']
    pr_nums = ['15811']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue18108'
    versions = ['Python 3.5']

    Linked PRs

    • gh-62308: Added dir_fd & follow_symlinks to shutil.chown #118136

    Activity

    1. cjwatson commented on May 31, 2013

      @cjwatson
      cjwatsonmannequin
      on May 31, 2013
      MannequinAuthor
      More actions

      Python 3.3 added the dir_fd and follow_symlinks keyword arguments to os.chown; it also added the shutil.chown function. Unfortunately the latter, while useful, does not support these new keyword arguments. It would be helpful if it did.

    2. cjwatson
      added
      stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
      on May 31, 2013
    3. PCManticore commented on Jun 13, 2014

      @PCManticore
      PCManticoremannequin
      on Jun 13, 2014
      Mannequin
      More actions

      Hi. Would you like to provide a patch?

    4. PCManticore
      added
      easy
      type-featureA feature request or enhancementA feature request or enhancement
      on Jun 13, 2014
    5. berkerpeksag commented on Jun 14, 2014

      @berkerpeksag
      berkerpeksag
      on Jun 14, 2014
      Member
      More actions

      Here's a patch.

    6. PCManticore commented on Jun 14, 2014

      @PCManticore
      PCManticoremannequin
      on Jun 14, 2014
      Mannequin
      More actions

      Looks good to me. But aren't the last two lines skipped if an error is raised by the first line from the with block?

      + with self.assertRaises(FileNotFoundError):
      + shutil.chown('invalid-file', user=uid, dir_fd=dirfd)
      + shutil.chown('invalid-file', group=gid, dir_fd=dirfd)
      + shutil.chown('invalid-file', user=uid, group=gid, dir_fd=dirfd)

    7. PCManticore commented on Jun 27, 2014

      @PCManticore
      PCManticoremannequin
      on Jun 27, 2014
      Mannequin
      More actions

      I got a failure on FreeBSD:

      [1/1] test_shutil
      test test_shutil failed -- Traceback (most recent call last):
        File "/tank/libs/cpython/Lib/test/test_shutil.py", line 1258, in test_chown
          shutil.chown(os.path.basename(filename), dir_fd=dirfd)
        File "/tank/libs/cpython/Lib/shutil.py", line 983, in chown
          raise ValueError("user and/or group must be set")
      ValueError: user and/or group must be set

      It seems that either user or group argument must be passed along with dir_fd.

    8. avinassh commented on Jun 29, 2019

      @avinassh
      avinasshmannequin
      on Jun 29, 2019
      Mannequin
      More actions

      I was looking for an easy patch to submit. I can take an attempt at this?

    9. tahia-khan commented on Sep 9, 2019

      @tahia-khan
      tahia-khanmannequin
      on Sep 9, 2019
      Mannequin
      More actions

      Hi everybody,

      I just submitted a PR for this issue. It's my first contribution to the cPython project so please let me know if I need to change anything.

    10. ezio-melotti
      transferred this issue fromon Apr 10, 2022
    11. serhiy-storchaka
      closed this as completedon Apr 22, 2024
    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

      easystdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions

        You are visitor 01402503 — GeezerVison does not store the pages you look up.
        Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.