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

Created on 2021-01-22 04:24 by barneygale, last changed 2021-04-07 18:33 by steve.dower. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 18909 barneygale, 2021-01-22 04:28
PR 24294 merged barneygale, 2021-01-22 04:52
PR 25257 merged steve.dower, 2021-04-07 16:29
PR 25258 merged steve.dower, 2021-04-07 17:14
Messages (4)
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.
msg390440 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-04-07 15:56
New changeset 8aac1bea2eeac25a49f8912b67aacbedf9bc7934 by Barney Gale in branch 'master':
bpo-42999: Expand and clarify pathlib.Path.link_to() documentation. (GH-24294)
https://github.com/python/cpython/commit/8aac1bea2eeac25a49f8912b67aacbedf9bc7934
msg390450 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-04-07 17:12
New changeset 34f93002bac980176a670ce2a4038c3be84effed by Steve Dower in branch '3.9':
bpo-42999: Expand and clarify pathlib.Path.link_to() documentation. (GH-24294)
https://github.com/python/cpython/commit/34f93002bac980176a670ce2a4038c3be84effed
msg390460 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-04-07 18:23
New changeset 9f578734624d1c0172220556ca97898730144172 by Steve Dower in branch '3.8':
bpo-42999: Expand and clarify pathlib.Path.link_to() documentation. (GH-24294)
https://github.com/python/cpython/commit/9f578734624d1c0172220556ca97898730144172
History
Date User Action Args
2021-04-07 18:33:34steve.dowersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-04-07 18:23:51steve.dowersetmessages: + msg390460
2021-04-07 17:14:48steve.dowersetpull_requests: + pull_request23994
2021-04-07 17:12:46steve.dowersetmessages: + msg390450
2021-04-07 16:29:58steve.dowersetpull_requests: + pull_request23993
2021-04-07 15:56:38steve.dowersetnosy: + steve.dower
messages: + msg390440
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