def remove_readonly(func, path, _):
 os.chmod(path, stat.S_IWRITE)
 func(path)

def remove_readonly ( func , path , _ ) : os . chmod ( path , stat . S_IWRITE ) func ( path )
clear the readonly bit and reattempt the removal .