bpo-18108: Adding dir_fd and follow_symlinks keyword args to shutil.chown (GH-15811)

* Adding dir_fd and follow_symlinks keyword args to shutil.chown
* Extending test_shutil.TestShutil.test_chown to include new kwargs
* Updating shutil.chown documentation

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
This commit is contained in:
tahia 2024-04-22 14:23:36 -04:00 committed by GitHub
parent 78ba4cb758
commit 8974a63f5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 53 additions and 4 deletions

View file

@ -421,7 +421,8 @@ Directory and files operations
.. availability:: Unix, Windows.
.. function:: chown(path, user=None, group=None)
.. function:: chown(path, user=None, group=None, *, dir_fd=None, \
follow_symlinks=True)
Change owner *user* and/or *group* of the given *path*.
@ -436,6 +437,9 @@ Directory and files operations
.. versionadded:: 3.3
.. versionchanged:: 3.13
Added *dir_fd* and *follow_symlinks* parameters.
.. function:: which(cmd, mode=os.F_OK | os.X_OK, path=None)

View file

@ -594,6 +594,10 @@ os.path
exactly one (back)slash to be absolute.
(Contributed by Barney Gale and Jon Foster in :gh:`44626`.)
* Add support of *dir_fd* and *follow_symlinks* keyword arguments in
:func:`shutil.chown`.
(Contributed by Berker Peksag and Tahia K in :gh:`62308`)
pathlib
-------