MCPcopy
hub / github.com/django/django / make_writeable

Method make_writeable

django/core/management/templates.py:396–404  ·  view source on GitHub ↗

Make sure that the file is writeable. Useful if our source is read-only.

(self, filename)

Source from the content-addressed store, hash-verified

394 os.chmod(new_path, current_mode & ~current_umask)
395
396 def make_writeable(self, filename):
397 """
398 Make sure that the file is writeable.
399 Useful if our source is read-only.
400 """
401 if not os.access(filename, os.W_OK):
402 st = os.stat(filename)
403 new_permissions = stat.S_IMODE(st.st_mode) | stat.S_IWUSR
404 os.chmod(filename, new_permissions)

Callers 1

handleMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected