Issue 18108: shutil.chown should support dir_fd and follow_symlinks keyword arguments (original) (raw)

Created on 2013-05-31 13:09 by cjwatson, last changed 2022-04-11 14:57 by admin.

Files
File name Uploaded Description Edit
issue18108.diff berker.peksag,2014-06-14 15:13 review
Pull Requests
URL Status Linked Edit
PR 15811 open ta1hia,2019-09-09 18:06
Messages (7)
msg190404 - (view) Author: Colin Watson (cjwatson) * Date: 2013-05-31 13:09
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.
msg220430 - (view) Author: PCManticore (Claudiu.Popa) * (Python triager) Date: 2014-06-13 11:12
Hi. Would you like to provide a patch?
msg220564 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2014-06-14 15:13
Here's a patch.
msg220565 - (view) Author: PCManticore (Claudiu.Popa) * (Python triager) Date: 2014-06-14 15:16
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)
msg221675 - (view) Author: PCManticore (Claudiu.Popa) * (Python triager) Date: 2014-06-27 06:08
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.
msg346893 - (view) Author: Avinash Sajjanshetty (avi) * Date: 2019-06-29 18:08
I was looking for an easy patch to submit. I can take an attempt at this?
msg351543 - (view) Author: Tahia K (ta1hia) * Date: 2019-09-09 18:21
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.
History
Date User Action Args
2022-04-11 14:57:46 admin set github: 62308
2019-10-28 20:48:21 pconnell set nosy: + pconnell
2019-09-09 18:21:09 ta1hia set messages: +
2019-09-09 18:06:54 ta1hia set pull_requests: + <pull%5Frequest15461>
2019-09-09 15:20:32 ta1hia set nosy: + ta1hia
2019-06-29 18:08:16 avi set nosy: + avimessages: +
2014-06-27 06:08:14 Claudiu.Popa set messages: +
2014-06-14 15:16:38 Claudiu.Popa set messages: +
2014-06-14 15:13:35 berker.peksag set files: + issue18108.diffnosy: + berker.peksagmessages: + keywords: + patchstage: needs patch -> patch review
2014-06-13 11:12:33 Claudiu.Popa set type: enhancementversions: + Python 3.5, - Python 3.4keywords: + easynosy: + Claudiu.Popamessages: + stage: needs patch
2013-05-31 16:28:16 hynek set nosy: + hynekversions: + Python 3.4, - Python 3.3
2013-05-31 13:09:57 cjwatson create