Antoine Pitrou added the comment:
os.path.isdir("foo") will return True if "foo" is a symlink to a directory, and
then shutil.rmtree("foo") will fail:
>>> os.path.isdir("foo")
True
>>> os.path.islink("foo")
True
>>> shutil.rmtree("foo")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/antoine/opt/lib/python3.3/shutil.py", line 456, in rmtree
"Not a directory: '{}'".format(path))
NotADirectoryError: [Errno 20] Not a directory: 'foo'
----------
nosy: +pitrou
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue15776>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com