##// END OF EJS Templates
py3: make sure util.username() always returns bytes...
Pulkit Goyal -
r38271:a4aa77b8 @36 default
parent child Browse files
Show More
@@ -541,9 +541,9 b' def username(uid=None):'
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.
General Comments 0
You need to be logged in to leave comments. Login now