[issue1669] shutil.rmtree fails on symlink, after deleting contents

Tim Koopman report at bugs.python.org
Thu Dec 20 17:40:32 CET 2007

Tim Koopman added the comment:

> While we are removing the contents of the target directory as expected,

This is not what I expected at all. I expected the function to fail,
because the target was not a directory, just a symlink to a directory.
That, or behavior similar to the command "rm -rf" which only removes the
symlink, but not the contents.

The current behavior is in my opinion inconsistent; if the symlink is
treated as a normal directory, it should also get deleted.

As I said, if the current behavior is apparently expected, it should be
documented, because I can think of no program that follow symlinks while
deleting unless specifically instructed to.

Tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list