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
Document behaviour of shutil.copy2 and copystat with symlinks #56392
Comments
see Neither python 2.7 nor 3.4 support lutime() syscall. |
Python 3.3 (as yet unreleased) supports the lutimes function: I'm changing the title to the second part of your question, documenting the behaviour of shutil.copy2 and copytree. |
Shouldn't at least shutil.copytree() use lutimes in Python 3.3 to copy symlink metadata if symlinks=True? |
Attached a patch that documents the behavior of copy2() and copytree() for symlinks. |
When shutil.copy2 already says that it's behavior is equivalent to cp -p, will adding this sentence + Symbolic links are not preserved. The contents and metadata of the Not actively confuse the user? Because cp -p's behavior includes that and I dont see a special mention without giving more details is going to help. The other portion of the patch seems okay to me. |
Senthil Kumaran wrote:
You're right. Only copytree() seems to understand symlinks, so I updated the patch to remove the first hunk. |
New changeset 209ad8920b03 by Senthil Kumaran in branch '2.7': |
New changeset 299992730c87 by Senthil Kumaran in branch '3.2': |
Petri, Thanks for the patch. It would also be helpful to track - "shutil.copytree() use lutimes in Python 3.3 to copy symlink metadata if symlinks=True". You can raise a feature request if it is not already raised. Thanks!. |
New changeset 746dc0a2398e by Ezio Melotti in branch 'default': |
Hi Ezio, It was intentional that I did not merge it to default. We want |
I applied it because the patch is valid on 3.3 too until we actually change copystat to use lutimes. If/when shutil is changed the doc can be updated accordingly. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: