py3: make posix.getuser return a bytes
authorPulkit Goyal <>
Fri, 21 Apr 2017 00:53:38 +0530
changeset 37235 f0ea0f64262714628cba98613958b3ce5e26a9de
parent 37234 c3342c1772115a2e3b1afce7157fcc061c39f18a
child 37236 c3dcec6cbc1bc3428f8d7b757a3621204a4e1742
push id505
push dateMon, 08 May 2017 16:32:18 +0000
py3: make posix.getuser return a bytes
--- a/mercurial/
+++ b/mercurial/
@@ -489,17 +489,17 @@ def statfiles(files):
         except OSError as err:
             if err.errno not in (errno.ENOENT, errno.ENOTDIR):
             st = None
         yield st
 def getuser():
     '''return name of current user'''
-    return getpass.getuser()
+    return pycompat.fsencode(getpass.getuser())
 def username(uid=None):
     """Return the name of the user with the given uid.
     If uid is None, return the name of the current user."""
     if uid is None:
         uid = os.getuid()