return _passwd_from_py(pwd.getpwuid(uid))
def getpwnam(name):
- return _passwd_from_py(pwd.getpwnam(name))
+ assert isinstance(name, bytes)
+ return _passwd_from_py(pwd.getpwnam(name.decode('iso-8859-1') if py_maj > 2
+ else name))
class Group:
return _group_from_py(grp.getgrgid(uid))
def getgrnam(name):
- return _group_from_py(grp.getgrnam(name))
+ assert isinstance(name, bytes)
+ return _group_from_py(grp.getgrnam(name.decode('iso-8859-1') if py_maj > 2
+ else name))
_uid_to_pwd_cache = {}