Author Arfrever
Recipients Arfrever, eric.araujo, ezio.melotti, georg.brandl, hynek, jcea, larry, loewis, mrts, ncoghlan, neologix, petri.lehtinen, pitrou, python-dev, rosslagerwall, schmir, tarek, teamnoir
Date 2012-06-27.20:32:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1340829136.66.0.00970777718045.issue4489@psf.upfronthosting.co.za>
In-reply-to
Content
The fix (c910af2e3c98 + 53fc7f59c7bb) for this issue broke deletion of directories, which contain symlinks to directories.
(Directories with symlinks to regular files or symlinks to nonexistent files are unaffected.)

$ mkdir -p /tmp/a/b
$ ln -s b /tmp/a/c
$ python3.2 -c 'import shutil; shutil.rmtree("/tmp/a")'
$ mkdir -p /tmp/a/b
$ ln -s b /tmp/a/c
$ python3.3 -c 'import shutil; shutil.rmtree("/tmp/a")'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib64/python3.3/shutil.py", line 447, in rmtree
    _rmtree_safe_fd(fd, path, onerror)
  File "/usr/lib64/python3.3/shutil.py", line 395, in _rmtree_safe_fd
    _rmtree_safe_fd(dirfd, fullname, onerror)
  File "/usr/lib64/python3.3/shutil.py", line 406, in _rmtree_safe_fd
    onerror(os.rmdir, path, sys.exc_info())
  File "/usr/lib64/python3.3/shutil.py", line 404, in _rmtree_safe_fd
    os.rmdir(path)
NotADirectoryError: [Errno 20] Not a directory: '/tmp/a/c'
$
History
Date User Action Args
2012-06-27 20:32:17Arfreversetrecipients: + Arfrever, loewis, georg.brandl, jcea, ncoghlan, pitrou, larry, schmir, tarek, ezio.melotti, eric.araujo, mrts, neologix, teamnoir, rosslagerwall, python-dev, petri.lehtinen, hynek
2012-06-27 20:32:16Arfreversetmessageid: <1340829136.66.0.00970777718045.issue4489@psf.upfronthosting.co.za>
2012-06-27 20:32:16Arfreverlinkissue4489 messages
2012-06-27 20:32:15Arfrevercreate