This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author draghuram
Recipients draghuram, ntkoopman
Date 2007-12-20.15:43:25
SpamBayes Score 0.48571998
Marked as misclassified No
Message-id <1198165406.11.0.486888917434.issue1669@psf.upfronthosting.co.za>
In-reply-to
Content
Please try to include stack trace in bug reports. I reproduced the error
on my Linux (SuSE 10). 

marvin:tmp$ ls -l dirlink testdir
lrwxrwxrwx 1 raghu users    7 2007-12-20 10:10 dirlink -> testdir/

testdir:
total 0
-rw-r--r-- 1 raghu users 0 2007-12-20 10:36 testfile

shutil.rmtree('dirlink') produces:

----------
Traceback (most recent call last):
  File "t.py", line 4, in <module>
    shutil.rmtree('dirlink')
  File "/localhome/raghu/localwork/cpython/python/Lib/shutil.py", line
194, in rmtree
    onerror(os.rmdir, path, sys.exc_info())
  File "/localhome/raghu/localwork/cpython/python/Lib/shutil.py", line
192, in rmtree
    os.rmdir(path)
OSError: [Errno 20] Not a directory: 'dirlink'
----------

While we are removing the contents of the target directory as expected,
the final 'rmdir' fails on removing the symbolic link. For the sake of
consistency, we can explicitly remove the target directory and leave the
symbolic link intact. Is this what you are expecting?
History
Date User Action Args
2007-12-20 15:43:26draghuramsetspambayes_score: 0.48572 -> 0.48571998
recipients: + draghuram, ntkoopman
2007-12-20 15:43:26draghuramsetspambayes_score: 0.48572 -> 0.48572
messageid: <1198165406.11.0.486888917434.issue1669@psf.upfronthosting.co.za>
2007-12-20 15:43:26draghuramlinkissue1669 messages
2007-12-20 15:43:25draghuramcreate