Skip to content

Commit f3c2508

Browse files
committed
gh-107959: clarify Unix-availability of os.lchmod()
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. Signed-off-by: Christoph Anton Mitterer <[email protected]>
1 parent 9c1c7ec commit f3c2508

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Doc/library/os.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2121,7 +2121,12 @@ features:
21212121

21222122
.. audit-event:: os.chmod path,mode,dir_fd os.lchmod
21232123

2124-
.. availability:: Unix, not Linux, FreeBSD >= 1.3, NetBSD >= 1.3, not OpenBSD
2124+
.. availability:: Unix.
2125+
2126+
.. note::
2127+
``lchmod()`` is not part of POSIX but Unix implementations may have it if
2128+
changing the mode of symbolic links is supported (for example on NetBSD
2129+
since 1.3 or FreeBSD since 3.0, but not on Linux or OpenBSD).
21252130

21262131
.. versionchanged:: 3.6
21272132
Accepts a :term:`path-like object`.

0 commit comments

Comments
 (0)