From patchwork Sat Mar 2 02:05:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D6039: py3: make sure return value of posix.groupname() is bytes From: phabricator X-Patchwork-Id: 38989 Message-Id: <49457c25da15b2b6ee8b5d0e5121dbbf@localhost.localdomain> To: mercurial-devel@mercurial-scm.org Date: Sat, 2 Mar 2019 02:05:19 +0000 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 To: pulkit, #hg-reviewers Cc: mercurial-devel 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