classification
Title: `pathlib.Path.link_to()` documentation is misleading
Type: behavior Stage: patch review
Components: Documentation Versions:
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: barneygale, docs@python, escape0707
Priority: normal Keywords: patch

Created on 2021-01-22 04:24 by barneygale, last changed 2021-01-22 04:52 by barneygale.

Pull Requests
URL Status Linked Edit
PR 18909 barneygale, 2021-01-22 04:28
PR 24294 open barneygale, 2021-01-22 04:52
Messages (1)
msg385474 - (view) Author: Barney Gale (barneygale) * Date: 2021-01-22 04:24
Compare the documentation of `symlink_to()` and `link_to()`:

.. method:: Path.symlink_to(target, target_is_directory=False)
    Make this path a symbolic link to *target*.

.. method:: Path.link_to(target)
    Create a hard link pointing to a path named *target*.

In fact, `link_to()` does something like:

    Make *target* a hard link to this path.

Which is unexpected given the naming and inconsistency with `symlink_to()`, but it's the way the current implementation works, and so the documentation should reflect that.

Adding a replacement `hardlink_to()` function is covered here in bpo-39950.
History
Date User Action Args
2021-01-22 04:52:18barneygalesetpull_requests: + pull_request23117
2021-01-22 04:28:25escape0707setnosy: + escape0707
2021-01-22 04:28:17barneygalesetkeywords: + patch
stage: patch review
pull_requests: + pull_request23116
2021-01-22 04:24:20barneygalecreate