MCPcopy
hub / github.com/django/django / _copy_permissions

Method _copy_permissions

django/utils/archive.py:108–115  ·  view source on GitHub ↗

If the file in the archive has some permissions (this assumes a file won't be writable/executable without being readable), apply those permissions to the unarchived file.

(mode, filename)

Source from the content-addressed store, hash-verified

106
107 @staticmethod
108 def _copy_permissions(mode, filename):
109 """
110 If the file in the archive has some permissions (this assumes a file
111 won't be writable/executable without being readable), apply those
112 permissions to the unarchived file.
113 """
114 if mode & stat.S_IROTH:
115 os.chmod(filename, mode)
116
117 def split_leading_dir(self, path):
118 path = str(path)

Callers 2

extractMethod · 0.80
extractMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected