[New-bugs-announce] [issue6547] shutil.copytree fails on dangling symlinks

Timothee Besset report at bugs.python.org
Wed Jul 22 22:50:23 CEST 2009

New submission from Timothee Besset <ttimo at idsoftware.com>:

shutil.copytree fails if there is a dangling symlink and symlink is set
to False (which is the default). It will raise an exception when trying
to get to the content of the symlink.

Tested on Debian Etch amd64, python 2.5.2

  File "/usr/lib/python2.5/shutil.py", line 138, in copytree
    raise Error, errors
shutil.Error: [('/opt/daemons/gameslave/.#fabfile.py',
'/tmp/tmphxInsp/gameslave/.#fabfile.py', "[Errno 2] No such file or
directory: '/opt/daemons/gameslave/.#fabfile.py'")]

$ ls -1l /opt/daemons/gameslave/.#fabfile.py
lrwxrwxrwx 1 timo quakelive 20 Jul 22 14:32
/opt/daemons/gameslave/.#fabfile.py -> timo at localhost.12341

(the link is created by emacs - means file being edited I'm guessing)

components: Library (Lib)
messages: 90821
nosy: TTimo
severity: normal
status: open
title: shutil.copytree fails on dangling symlinks
type: behavior
versions: Python 2.5

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list