D6039: py3: make sure return value of posix.groupname() is bytes

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Fri Mar 1 21:05:19 EST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGfaa04f45b5fe: py3: make sure return value of posix.groupname() is bytes (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6039?vs=14282&id=14286

REVISION DETAIL
  https://phab.mercurial-scm.org/D6039

AFFECTED FILES
  mercurial/posix.py

CHANGE DETAILS

diff --git a/mercurial/posix.py b/mercurial/posix.py
--- a/mercurial/posix.py
+++ b/mercurial/posix.py
@@ -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



To: pulkit, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list