[New-bugs-announce] [issue9993] shutil.move fails on symlink source

Jonathan Niehof report at bugs.python.org
Thu Sep 30 01:03:12 CEST 2010


New submission from Jonathan Niehof <jniehof at lanl.gov>:

shutil.move does not behave as I expect when moving a symlink across filesystems. (This is when src itself is a symlink, not when it is a directory tree including symlinks.)

-If src is a symlink to file, rather than moving the symlink, it copies the contents of the file
-If src is a symlink to a directory, rather than moving the symlink, it copies the contents of the directory to a new directory
-If src is a dangling symlink, it errors out

Attached patch against the py3k branch adds tests for these cases and adds the expected behaviour, which is to recreate the symlink.

(I have encountered this on 2.6 - current SVN; it is probably in 2.5 as well but I have not confirmed.)

----------
components: Library (Lib)
files: shutil_move_symlinks.patch
keywords: patch
messages: 117673
nosy: jniehof
priority: normal
severity: normal
status: open
title: shutil.move fails on symlink source
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file19063/shutil_move_symlinks.patch

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


More information about the New-bugs-announce mailing list