summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorSandro Tosi <sandro.tosi@gmail.com>2011-08-22 21:28:27 (GMT)
committerSandro Tosi <sandro.tosi@gmail.com>2011-08-22 21:28:27 (GMT)
commitd902a14dd0ed29bda061f3c0e4cfe355f2763462 (patch)
tree37633787b7ecbbd8d71e558ee92429c1248d44d0 /Doc/library
parent6f2a683a0c4ec0b3fe3ed840336853ebf26004c0 (diff)
downloadcpython-d902a14dd0ed29bda061f3c0e4cfe355f2763462.zip
cpython-d902a14dd0ed29bda061f3c0e4cfe355f2763462.tar.gz
cpython-d902a14dd0ed29bda061f3c0e4cfe355f2763462.tar.bz2
#12191: add shutil.chown() to change user and/or group owner of a given path also specifying their names.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/os.rst3
-rw-r--r--Doc/library/shutil.rst14
2 files changed, 17 insertions, 0 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index 47e6a1b..0c5c40c 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -1530,6 +1530,9 @@ Files and Directories
Change the owner and group id of *path* to the numeric *uid* and *gid*. To leave
one of the ids unchanged, set it to -1.
+ See :func:`shutil.chown` for a higher-level function that accepts names in
+ addition to numeric ids.
+
Availability: Unix.
diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst
index 0d80913..d87e605 100644
--- a/Doc/library/shutil.rst
+++ b/Doc/library/shutil.rst
@@ -183,6 +183,20 @@ Directory and files operations
Availability: Unix, Windows.
+.. function:: chown(path, user=None, group=None)
+
+ Change owner *user* and/or *group* of the given *path*.
+
+ *user* can be a system user name or a uid; the same applies to *group*. At
+ least one argument is required.
+
+ See also :func:`os.chown`, the underlying function.
+
+ Availability: Unix.
+
+ .. versionadded:: 3.3
+
+
.. exception:: Error
This exception collects exceptions that are raised during a multi-file