{{ message }}
GH-73991: Add follow_symlinks argument to pathlib.Path.copy()#120519
Merged
barneygale merged 4 commits intoJun 19, 2024
Merged
GH-73991: Add follow_symlinks argument to pathlib.Path.copy()#120519barneygale merged 4 commits into
pathlib.Path.copy()#120519barneygale merged 4 commits into
Conversation
Add support for not following symlinks in `pathlib.Path.copy()`. On Windows we add the `COPY_FILE_COPY_SYMLINK` flag is following symlinks is disabled. If the source is symlink to a directory, this call will fail with `ERROR_ACCESS_DENIED`. In this case we add `COPY_FILE_DIRECTORY` to the flags and retry.
pathlib.Path.copy()
zooba
approved these changes
Jun 18, 2024
zooba
left a comment
Member
There was a problem hiding this comment.
Looks good, left some thoughts, but nothing blocking.
Sorry, something went wrong.
eryksun
reviewed
Jun 19, 2024
mrahtz
pushed a commit
to mrahtz/cpython
that referenced
this pull request
Jun 30, 2024
…python#120519) Add support for not following symlinks in `pathlib.Path.copy()`. On Windows we add the `COPY_FILE_COPY_SYMLINK` flag is following symlinks is disabled. If the source is symlink to a directory, this call will fail with `ERROR_ACCESS_DENIED`. In this case we add `COPY_FILE_DIRECTORY` to the flags and retry. This can fail on old Windowses, which we note in the docs. No news as `copy()` was only just added.
noahbkim
pushed a commit
to hudson-trading/cpython
that referenced
this pull request
Jul 11, 2024
…python#120519) Add support for not following symlinks in `pathlib.Path.copy()`. On Windows we add the `COPY_FILE_COPY_SYMLINK` flag is following symlinks is disabled. If the source is symlink to a directory, this call will fail with `ERROR_ACCESS_DENIED`. In this case we add `COPY_FILE_DIRECTORY` to the flags and retry. This can fail on old Windowses, which we note in the docs. No news as `copy()` was only just added.
estyxx
pushed a commit
to estyxx/cpython
that referenced
this pull request
Jul 17, 2024
…python#120519) Add support for not following symlinks in `pathlib.Path.copy()`. On Windows we add the `COPY_FILE_COPY_SYMLINK` flag is following symlinks is disabled. If the source is symlink to a directory, this call will fail with `ERROR_ACCESS_DENIED`. In this case we add `COPY_FILE_DIRECTORY` to the flags and retry. This can fail on old Windowses, which we note in the docs. No news as `copy()` was only just added.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.
Add support for not following symlinks in
pathlib.Path.copy().On Windows we add the
COPY_FILE_COPY_SYMLINKflag is following symlinks is disabled. If the source is symlink to a directory, this call will fail withERROR_ACCESS_DENIED. In this case we addCOPY_FILE_DIRECTORYto the flags and retry. This can fail on old Windowses, which we note in the docs.No news as
copy()was only just added.📚 Documentation preview 📚: https://cpython-previews--120519.org.readthedocs.build/