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 <rep...@bugs.python.org> <http://bugs.python.org/issue19643> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com