D5794: py3: pass str into grp.getgrnam

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Fri Feb 1 18:31:42 EST 2019


pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  grp.getgrnam expects str on Python 3.
  
  This fixes test-acl.t on Python 3.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  contrib/python3-whitelist
  mercurial/posix.py

CHANGE DETAILS

diff --git a/mercurial/posix.py b/mercurial/posix.py
--- a/mercurial/posix.py
+++ b/mercurial/posix.py
@@ -583,6 +583,7 @@
     """Return the list of members of the group with the given
     name, KeyError if the group does not exist.
     """
+    name = pycompat.sysstr(name)
     return list(grp.getgrnam(name).gr_mem)
 
 def spawndetached(args):
diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -5,6 +5,7 @@
 test-absorb-rename.t
 test-absorb-strip.t
 test-absorb.t
+test-acl.t
 test-add.t
 test-addremove-similar.t
 test-addremove.t



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


More information about the Mercurial-devel mailing list