shutil.rmtree(filename)
   File "/usr/lib64/python2.5/shutil.py", line 178, in rmtree
     onerror(os.rmdir, path, sys.exc_info())
   File "/usr/lib64/python2.5/shutil.py", line 176, in rmtree
     os.rmdir(path)
OSError: [Errno 39] Directory not empty: /path/to/my/dir

According to the documentation, shutil.rmtree should not care about directory being not empty.

This sounds suspiciously like a permission issue. rmtree() *should* walk the tree removing items *if it can*. If a file can't be deleted, it treats it as an error. rmtree() takes parameters for ignore_errors and an onerror callback function, so you can catch these error conditions.

-tkc


--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to