[issue19643] shutil rmtree fails on readonly files in Windows

Zachary Ware report at bugs.python.org
Tue May 6 23:17:30 CEST 2014


Zachary Ware added the comment:

I'm good with just adding an example to the docs, along the lines of Paul's del_rw.  I think it would be better to use a more conservative example though, something like:

   def readonly_handler(rm_func, path, exc_info):
       if issubclass(exc_info[0], PermissionError) and exc_info[1].winerror == 5:
           os.chmod(path, stat.S_IWRITE)
           return rm_func(path)
       raise exc_info[1]

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19643>
_______________________________________


More information about the Python-bugs-list mailing list