Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHGa4aa77b84efd: py3: make sure util.username() always returns bytes
rHGb4269bbbefbc: py3: make sure util.username() always returns bytes
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Event Timeline
Comment Actions
@@ -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' %.
Comment Actions
I was afraid that someone can pass uid as a str or bytes. I will followup with the suggestion.