mercurial/posix.py
changeset 38264 a4aa77b84efd
parent 38199 cc9aa88792fe
child 39909 5fe0b880200e
equal deleted inserted replaced
38263:47b9240615ca 38264:a4aa77b84efd
   539     If uid is None, return the name of the current user."""
   539     If uid is None, return the name of the current user."""
   540 
   540 
   541     if uid is None:
   541     if uid is None:
   542         uid = os.getuid()
   542         uid = os.getuid()
   543     try:
   543     try:
   544         return pwd.getpwuid(uid)[0]
   544         return pycompat.fsencode(pwd.getpwuid(uid)[0])
   545     except KeyError:
   545     except KeyError:
   546         return str(uid)
   546         return b'%d' % uid
   547 
   547 
   548 def groupname(gid=None):
   548 def groupname(gid=None):
   549     """Return the name of the group with the given gid.
   549     """Return the name of the group with the given gid.
   550 
   550 
   551     If gid is None, return the name of the current group."""
   551     If gid is None, return the name of the current group."""