MCPcopy
hub / github.com/pytest-dev/pytest / chmod

Method chmod

src/_pytest/_py/path.py:1033–1043  ·  view source on GitHub ↗

Change permissions to the given mode. If mode is an integer it directly encodes the os-specific modes. if rec is True perform recursively.

(self, mode, rec=0)

Source from the content-addressed store, hash-verified

1031 return self.strpath
1032
1033 def chmod(self, mode, rec=0):
1034 """Change permissions to the given mode. If mode is an
1035 integer it directly encodes the os-specific modes.
1036 if rec is True perform recursively.
1037 """
1038 if not isinstance(mode, int):
1039 raise TypeError(f"mode {mode!r} must be an integer")
1040 if rec:
1041 for x in self.visit(rec=rec):
1042 error.checked_call(os.chmod, str(x), mode)
1043 error.checked_call(os.chmod, self.strpath, mode)
1044
1045 def pypkgpath(self):
1046 """Return the Python package path by looking for the last

Callers 15

removeMethod · 0.95
chmod_rwFunction · 0.80
_make_cachedirFunction · 0.80
getbasetempMethod · 0.80
unwritable_cache_dirMethod · 0.80
test_zipfileMethod · 0.80
test_readonlyMethod · 0.80
chmod_rMethod · 0.80

Calls 2

visitMethod · 0.95
checked_callMethod · 0.80