MCPcopy Create free account
hub / github.com/davisking/dlib / remove_read_only

Function remove_read_only

setup.py:102–108  ·  view source on GitHub ↗
(func, path, exc)

Source from the content-addressed store, hash-verified

100 """remove a directory and its subdirectories.
101 """
102 def remove_read_only(func, path, exc):
103 excvalue = exc[1]
104 if func in (os.rmdir, os.remove) and excvalue.errno == errno.EACCES:
105 os.chmod(path, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)
106 func(path)
107 else:
108 raise
109
110 if os.path.exists(name):
111 log.info('Removing old directory {}'.format(name))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected