-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Documentation for pathlib.Path.symlink_to is incorrectly constrained #105900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
As a demo: >>> import os, pathlib
>>> os.name
'nt'
>>> pathlib.Path('foo').mkdir()
>>> pathlib.Path('bar').symlink_to('foo')
>>> os.path.isdir('bar')
True |
barneygale
added a commit
to barneygale/cpython
that referenced
this issue
Jan 13, 2024
…)` docs Clarify that *target_is_directory* only matters if the target doesn't exist.
barneygale
added a commit
that referenced
this issue
Jan 23, 2024
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Jan 23, 2024
…)` docs (pythonGH-114035) 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]>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Jan 23, 2024
…)` docs (pythonGH-114035) 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]>
This was referenced Jan 23, 2024
Merged
barneygale
added a commit
that referenced
this issue
Jan 23, 2024
….)` 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]>
barneygale
added a commit
that referenced
this issue
Jan 23, 2024
….)` docs (GH-114035) (#114465) 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]>
Fixed! |
aisk
pushed a commit
to aisk/cpython
that referenced
this issue
Feb 11, 2024
…)` docs (python#114035) Clarify that *target_is_directory* only matters if the target doesn't exist.
Glyphack
pushed a commit
to Glyphack/cpython
that referenced
this issue
Sep 2, 2024
…)` docs (python#114035) Clarify that *target_is_directory* only matters if the target doesn't exist.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Documentation
The docs for
symlink_to
state:That's not precisely correct. I experimented and
symlink_to
seems to follow the same behavior as os.symlink, which provides the correct (though more complicated) guidance:That is, both calls will infer the type of the target if it's present. The caller need not pass target_is_directory if the target is an extant directory. The
symlink_to
documentation is misleading and incorrect.Linked PRs
pathlib.Path.symlink_to(target_is_directory=...)
docs #114035pathlib.Path.symlink_to(target_is_directory=...)
docs (GH-114035) #114464pathlib.Path.symlink_to(target_is_directory=...)
docs (GH-114035) #114465The text was updated successfully, but these errors were encountered: