equal
deleted
inserted
replaced
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.""" |