Why does mercurial.util.username() return None on Windows?

Augie Fackler raf at durin42.com
Mon Jul 8 14:58:36 EDT 2019

I just tripped on this today: https://www.mercurial-scm.org/repo/hg/file/tip/mercurial/windows.py#l514

It's been that way since at least 2009 when mpm split out the {posix,windows,win32} modules. Does anyone (maybe mharbison?) have an idea why this is the case? Would it be okay to make util.username(None) return getpass.getuser() on Windows? I'm guessing the answer is yes, but figured I should ask some Windows gurus before I leap into the unknown.


More information about the Mercurial-devel mailing list