Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Document behavior of Path.symlink_to() when source already exists #132416

Open
Labels
@bmispelon

Description

@bmispelon

Documentation

The documentation forPath.symlink_to()[1] does not mention what happens when the source already exists, e.g.:

>>> from pathlib import Path>>> Path("source").symlink_to("target1")>>> Path("source").symlink_to("target2")Traceback (most recent call last):  File "<python-input-2>", line 1, in <module>    Path("source").symlink_to("target2")    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^  File "/usr/lib/python3.13/pathlib/_local.py", line 789, in symlink_to    os.symlink(target, self, target_is_directory)    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^FileExistsError: [Errno 17] File exists: 'target2' -> 'source'

(The same applies toos.symlink[2] by the way)

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp