Beispiel #1
0
def getgrnam(name):
    if not isinstance(name, str):
        raise TypeError("expected string")
    res = lib.getgrnam(os.fsencode(name))
    if not res:
        raise KeyError("'getgrnam(): name not found: %s'" % name)
    return _group_from_gstruct(res)
Beispiel #2
0
def getgrnam(name):
    if not isinstance(name, str):
        raise TypeError("expected string")
    res = lib.getgrnam(os.fsencode(name))
    if not res:
        raise KeyError("'getgrnam(): name not found: %s'" % name)
    return _group_from_gstruct(res)
Beispiel #3
0
def getgrnam(name):
    name = str(name)
    with _lock:
        res = lib.getgrnam(name)
        if not res:
            raise KeyError("getgrnam(): name not found: %s" % name)
        return _group_from_gstruct(res)
def getgrnam(name):
    if not isinstance(name, basestring):
        raise TypeError("expected string")
    name = str(name)
    res = lib.getgrnam(name)
    if not res:
        raise KeyError("'getgrnam(): name not found: %s'" % name)
    return _group_from_gstruct(res)
def getgrnam(name):
    if not isinstance(name, basestring):
        raise TypeError("expected string")
    name = str(name)
    res = lib.getgrnam(name)
    if not res:
        raise KeyError("'getgrnam(): name not found: %s'" % name)
    return _group_from_gstruct(res)
Beispiel #6
0
def getgrnam(name):
    if not isinstance(name, str):
        raise TypeError("expected string")
    name_b = os.fsencode(name)
    if b'\0' in name_b:
        raise ValueError("embedded null byte")
    with _lock:
        res = lib.getgrnam(name_b)
        if not res:
            raise KeyError("getgrnam(): name not found: %s" % name)
        return _group_from_gstruct(res)