From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Wed, 13 Dec 2023 20:01:39 +0000 (+0100) Subject: [3.12] gh-107959: clarify Unix-availability of `os.lchmod()` (GH-107960) (GH-113066) X-Git-Tag: v3.12.2~328 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4d7c24b9a981afa9ccee54877ead5f6cf63d3e2c;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-107959: clarify Unix-availability of `os.lchmod()` (GH-107960) (GH-113066) gh-107959: clarify Unix-availability of `os.lchmod()` (GH-107960) POSIX specifies that implementations are not required to support changing the file mode of symbolic links, but may do so. Consequently, `lchmod()` is not part of POSIX (but mentioned for implementations which do support the above). The current wording of the availability of `os.lchmod()` is rather vague and improved to clearly tell which POSIX/Unix/BSD-like support the function in general (those that support changing the file mode of symbolic links). Further, some examples of major implementations are added. Data for the BSDs taken from their online manpages. (cherry picked from commit f14e3d59c955fb3cf89e5241727ec566164dcf42) Signed-off-by: Christoph Anton Mitterer Co-authored-by: Christoph Anton Mitterer Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> --- diff --git a/Doc/library/os.rst b/Doc/library/os.rst index bf97dfd1f2f6..4507fbc8164d 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -2160,9 +2160,12 @@ features: for possible values of *mode*. As of Python 3.3, this is equivalent to ``os.chmod(path, mode, follow_symlinks=False)``. + ``lchmod()`` is not part of POSIX, but Unix implementations may have it if + changing the mode of symbolic links is supported. + .. audit-event:: os.chmod path,mode,dir_fd os.lchmod - .. availability:: Unix. + .. availability:: Unix, not Linux, FreeBSD >= 1.3, NetBSD >= 1.3, not OpenBSD .. versionchanged:: 3.6 Accepts a :term:`path-like object`.