Skip to content

Commit

Permalink
pythonGH-105900: Fix `pathlib.Path.symlink_to(target_is_directory=...…
Browse files Browse the repository at this point in the history
…)` docs (python#114035)

Clarify that *target_is_directory* only matters if the target doesn't
exist.
  • Loading branch information
barneygale authored and aisk committed Feb 11, 2024
1 parent 54725d2 commit 80e0ade
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Doc/library/pathlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1539,9 +1539,13 @@ call fails (for example because the path doesn't exist).

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

Make this path a symbolic link to *target*. Under Windows,
*target_is_directory* must be true (default ``False``) if the link's target
is a directory. Under POSIX, *target_is_directory*'s value is ignored.
Make this path a symbolic link pointing to *target*.

On Windows, a symlink represents either a file or a directory, and does not
morph to the target dynamically. If the target is present, the type of the
symlink will be created to match. Otherwise, the symlink will be created
as a directory if *target_is_directory* is ``True`` or a file symlink (the
default) otherwise. On non-Windows platforms, *target_is_directory* is ignored.

::

Expand Down

0 comments on commit 80e0ade

Please sign in to comment.