D3706: py3: make sure util.username() always returns bytes

Yuya Nishihara yuya at tcha.org
Sat Jun 9 22:17:11 EDT 2018


> @@ -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 pycompat.bytestr(uid)

Nit: could be `b'%d' %`.


More information about the Mercurial-devel mailing list