This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Tom Hale
Recipients Tom Hale
Date 2020-06-27.03:26:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1593228362.42.0.387933635808.issue41134@roundup.psfhosted.org>
In-reply-to
Content
Here is a minimal test case:

==========================================================
#!/bin/bash

cd /tmp || exit 1

dir=test-copy_tree
src=$dir/src
dst=$dir/dst

mkdir -p "$src"
touch "$src"/file
ln -s file "$src/symlink"

python -c "from distutils.dir_util import copy_tree;
copy_tree('$src', '$dst', preserve_symlinks=1, update=1);
copy_tree('$src', '$dst', preserve_symlinks=1, update=1);"

rm -r "$dir"

==========================================================

Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "/usr/lib/python3.8/distutils/dir_util.py", line 152, in copy_tree
    os.symlink(link_dest, dst_name)
FileExistsError: [Errno 17] File exists: 'file' -> 'test-copy_tree/dst/symlink'

==========================================================


Related:
=========

This issue will likely be resolved via:

bpo-36656 Add race-free os.link and os.symlink wrapper / helper

https://bugs.python.org/issue36656
(WIP under discussion at python-mentor)


Prior art:
===========
https://stackoverflow.com/questions/53090360/python-distutils-copy-tree-fails-to-update-if-there-are-symlinks
History
Date User Action Args
2020-06-27 03:26:02Tom Halesetrecipients: + Tom Hale
2020-06-27 03:26:02Tom Halesetmessageid: <1593228362.42.0.387933635808.issue41134@roundup.psfhosted.org>
2020-06-27 03:26:02Tom Halelinkissue41134 messages
2020-06-27 03:26:02Tom Halecreate