MCPcopy Index your code
hub / github.com/python/cpython / _get_gid

Function _get_gid

Lib/shutil.py:956–972  ·  view source on GitHub ↗

Returns a gid, given a group name.

(name)

Source from the content-addressed store, hash-verified

954 return hasattr(st, 'st_flags') and st.st_flags in immutable_states
955
956def _get_gid(name):
957 """Returns a gid, given a group name."""
958 if name is None:
959 return None
960
961 try:
962 from grp import getgrnam
963 except ImportError:
964 return None
965
966 try:
967 result = getgrnam(name)
968 except KeyError:
969 result = None
970 if result is not None:
971 return result[2]
972 return None
973
974def _get_uid(name):
975 """Returns an uid, given a user name."""

Callers 2

_make_tarballFunction · 0.85
chownFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…