Skip to content

Commit 4d7c24b

Browse files
miss-islingtoncalestyoAA-Turner
authored
[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 f14e3d5) Signed-off-by: Christoph Anton Mitterer <[email protected]> Co-authored-by: Christoph Anton Mitterer <[email protected]> Co-authored-by: Adam Turner <[email protected]>
1 parent d84aa5c commit 4d7c24b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Doc/library/os.rst

+4-1
Original file line numberDiff line numberDiff line change
@@ -2160,9 +2160,12 @@ features:
21602160
for possible values of *mode*. As of Python 3.3, this is equivalent to
21612161
``os.chmod(path, mode, follow_symlinks=False)``.
21622162

2163+
``lchmod()`` is not part of POSIX, but Unix implementations may have it if
2164+
changing the mode of symbolic links is supported.
2165+
21632166
.. audit-event:: os.chmod path,mode,dir_fd os.lchmod
21642167

2165-
.. availability:: Unix.
2168+
.. availability:: Unix, not Linux, FreeBSD >= 1.3, NetBSD >= 1.3, not OpenBSD
21662169

21672170
.. versionchanged:: 3.6
21682171
Accepts a :term:`path-like object`.

0 commit comments

Comments
 (0)