[issue19643] shutil rmtree fails on readonly files in Windows

Paul Moore report at bugs.python.org
Tue Jan 21 15:44:05 CET 2014


Paul Moore added the comment:

The most obvious solution would be if the onerror argument allowed for retries. At the moment, all it can do is report issues, not recover. Suppose that returning True from onerror meant "retry the operation". Then you could do

    def set_rw(operation, name, exc):
        os.chmod(name, stat.S_IWRITE)
        return True

    shutil.rmtree('path', onerror=set_rw)

----------
nosy: +pmoore

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


More information about the Python-bugs-list mailing list