mercurial/posix.py
changeset 38252 a4aa77b84efd
parent 38166 cc9aa88792fe
child 39904 5fe0b880200e
--- a/mercurial/posix.py	Sat Jun 09 15:01:04 2018 +0530
+++ b/mercurial/posix.py	Sat Jun 09 15:14:31 2018 +0530
@@ -541,9 +541,9 @@
     if uid is None:
         uid = os.getuid()
     try:
-        return pwd.getpwuid(uid)[0]
+        return pycompat.fsencode(pwd.getpwuid(uid)[0])
     except KeyError:
-        return str(uid)
+        return b'%d' % uid
 
 def groupname(gid=None):
     """Return the name of the group with the given gid.