Closed
Description
The behavior of shutil.copymode()
on Windows was changed by adding os.lchmod()
in #59616. Now if follow_symlinks is false and both src and dst are symlinks, it copies the symlink mode (only the read-only bit). Previously it did nothing.
But there is still a difference between Windows and POSIX. If follow_symlinks is true and dst is a symlink, it sets the permission of the symlink on Windows (because os.chmod()
still does not follow symlinks by default on Windows) and the permission of the target on POSIX.
shutil.copystat()
has different behavior, because it passes the follow_symlinks argument explicitly.
I propose to harmonize shutil.copymode()
behavior on Windows with POSIX and with shutil.copystat()
.