Re: Completely Deleting A Directory

2010-04-26 Thread Lawrence D'Oliveiro
In message <86bb4820-ab5a-49cc-9e64-7f7e609e4...@y6g2000prk.googlegroups.com>, MrJean1 wrote: > 2) Function rmtree in the shutil module considers symlinks to a > directory an error > since Python > 2.6. I don’t think that applies to subd

Re: Completely Deleting A Directory

2010-04-26 Thread Patrick Maupin
On Apr 26, 4:09 am, Lawrence D'Oliveiro wrote: > It doesn’t seem to mention in the documentation for os.walk > that symlinks to directories are > returned in the list of directories, not the list of files. This will lead > to an error in the os.rmdir call i

Re: Completely Deleting A Directory

2010-04-26 Thread MrJean1
The answer to 1) is no, due to topdown = False in the call to os.walk. /Jean On Apr 26, 8:31 am, MrJean1 wrote: > Two comments: > > 1) Should delete_dir not be called instead of os.rmdir in this line > >                 (os.rmdir, os.remove)[os.path.islink(item)](item) > > 2) Function rmtree in

Re: Completely Deleting A Directory

2010-04-26 Thread MrJean1
Two comments: 1) Should delete_dir not be called instead of os.rmdir in this line (os.rmdir, os.remove)[os.path.islink(item)](item) 2) Function rmtree in the shutil module considers symlinks to a directory an error since

Completely Deleting A Directory

2010-04-26 Thread Lawrence D'Oliveiro
It doesn’t seem to mention in the documentation for os.walk that symlinks to directories are returned in the list of directories, not the list of files. This will lead to an error in the os.rmdir call in the example directory-deletion routine on that pag