comparison mercurial/posix.py @ 41827:faa04f45b5fe

py3: make sure return value of posix.groupname() is bytes Differential Revision: https://phab.mercurial-scm.org/D6039
author Pulkit Goyal <pulkit@yandex-team.ru>
date Sat, 02 Mar 2019 05:01:00 +0530
parents 3ef8bec91465
children 97ada9b8d51b
comparison
equal deleted inserted replaced
41826:867883d454ea 41827:faa04f45b5fe
573 If gid is None, return the name of the current group.""" 573 If gid is None, return the name of the current group."""
574 574
575 if gid is None: 575 if gid is None:
576 gid = os.getgid() 576 gid = os.getgid()
577 try: 577 try:
578 return grp.getgrgid(gid)[0] 578 return pycompat.fsencode(grp.getgrgid(gid)[0])
579 except KeyError: 579 except KeyError:
580 return str(gid) 580 return pycompat.bytestr(gid)
581 581
582 def groupmembers(name): 582 def groupmembers(name):
583 """Return the list of members of the group with the given 583 """Return the list of members of the group with the given
584 name, KeyError if the group does not exist. 584 name, KeyError if the group does not exist.
585 """ 585 """