# HG changeset patch # User Pulkit Goyal # Date 2019-03-01 23:31:00 # Node ID faa04f45b5fe4e815c319c4d1c2ff4047c5a3c67 # Parent 867883d454eaa8f72843e678e9580f866efa5779 py3: make sure return value of posix.groupname() is bytes Differential Revision: https://phab.mercurial-scm.org/D6039 diff --git a/mercurial/posix.py b/mercurial/posix.py --- a/mercurial/posix.py +++ b/mercurial/posix.py @@ -575,9 +575,9 @@ def groupname(gid=None): if gid is None: gid = os.getgid() try: - return grp.getgrgid(gid)[0] + return pycompat.fsencode(grp.getgrgid(gid)[0]) except KeyError: - return str(gid) + return pycompat.bytestr(gid) def groupmembers(name): """Return the list of members of the group with the given