Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ccd8d77

Browse files
[3.12] GH-105900: Fix pathlib.Path.symlink_to(target_is_directory=...) docs (GH-114035) (#114464)
Clarify that *target_is_directory* only matters if the target doesn't exist. (cherry picked from commit b822b85) Co-authored-by: Barney Gale <[email protected]>
1 parent 9c2db57 commit ccd8d77

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Doc/library/pathlib.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,9 +1387,13 @@ call fails (for example because the path doesn't exist).
13871387

13881388
.. method:: Path.symlink_to(target, target_is_directory=False)
13891389

1390-
Make this path a symbolic link to *target*. Under Windows,
1391-
*target_is_directory* must be true (default ``False``) if the link's target
1392-
is a directory. Under POSIX, *target_is_directory*'s value is ignored.
1390+
Make this path a symbolic link pointing to *target*.
1391+
1392+
On Windows, a symlink represents either a file or a directory, and does not
1393+
morph to the target dynamically. If the target is present, the type of the
1394+
symlink will be created to match. Otherwise, the symlink will be created
1395+
as a directory if *target_is_directory* is ``True`` or a file symlink (the
1396+
default) otherwise. On non-Windows platforms, *target_is_directory* is ignored.
13931397

13941398
::
13951399

0 commit comments

Comments
 (0)