changeset 41832: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 867883d454ea
children bce2356ece68
files mercurial/posix.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/posix.py	Fri Mar 01 02:53:09 2019 +0900
+++ b/mercurial/posix.py	Sat Mar 02 05:01:00 2019 +0530
@@ -575,9 +575,9 @@
     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