diff --git a/mercurial/posix.py b/mercurial/posix.py --- a/mercurial/posix.py +++ b/mercurial/posix.py @@ -543,7 +543,7 @@ try: return pycompat.fsencode(pwd.getpwuid(uid)[0]) except KeyError: - return pycompat.bytestr(uid) + return b'%d' % uid def groupname(gid=None): """Return the name of the group with the given gid.