def rmtree(path, ignore_errors=False, onerror=None):
    if ignore_errors:
        def onerror(*args):
            pass
    elif onerror is None:
        def onerror(*args):
            raise
    for root, dirs, unused_files in os.walk(path):
        for directory in dirs:
            try:
                abs_directory = os.path.join(root, directory)
                os.chmod(abs_directory, stat.S_IRWXU)
            except EnvironmentError as e:
                onerror(os.chmod, abs_directory, e)
    shutil.rmtree(path, ignore_errors=ignore_errors, onerror=onerror)
Replacing the File Content of a Resource
dataset/ETHPy150Open sosy-lab/benchexec/benchexec/util.py/rmtree--crossover with--dataset/ETHPy150Open swordapp/python-client-sword2/sword2/connection.py/Connection.update_files_for_resource