shutil module question

Bryan BZ bryanbz at yahoo.com
Tue Oct 17 12:27:09 EDT 2000


I am trying to delete a dir tree using shutil.rmtree(pathname) but for some
reason it won't delete the last remaining file in each pathname.  I keep
getting an error "Permission denied", so for now I let it ignore the error
and still get one file left in each directory....

My code *looks* like this:

for file in os.listdir(pathname)

    ...do something...
    file.close()

shutil.rmtree(pathname)





More information about the Python-list mailing list