[issue12715] Add symlink support to shutil functions

Petri Lehtinen report at bugs.python.org
Tue Aug 9 16:50:40 CEST 2011


Petri Lehtinen <petri at digip.org> added the comment:

> Doing what UNIX’ cp program does would be best here.

$ cp --version
cp (GNU coreutils) 8.5

$ touch file
$ ln -s file link_to_file 
$ mkdir directory
$ ln -s directory link_to_directory
$ cp -a link_to_file link_to_directory
$ ls -l directory
lrwxrwxrwx 1 user user 4 2011-08-09 17:46 link_to_file -> file

So at least cp from GNU coreutils seems to copy the link into the directory, dereferencing the dst link.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12715>
_______________________________________


More information about the Python-bugs-list mailing list