py3: convert hg executable path to bytes in missing case in procutil
We (Google) noticed this in our tests when we use chg and a hg wrapper
script not called 'hg'. The executable then ended up being a native
string, which then failed in chgserver when trying to convert the
environment dict to a byte string.
Differential Revision: https://phab.mercurial-scm.org/D6775
--- a/mercurial/utils/procutil.py Sat Aug 31 10:26:39 2019 -0700
+++ b/mercurial/utils/procutil.py Thu Aug 29 23:38:24 2019 -0700
@@ -246,7 +246,7 @@
_sethgexecutable(pycompat.fsencode(mainmod.__file__))
else:
exe = findexe('hg') or os.path.basename(sys.argv[0])
- _sethgexecutable(exe)
+ _sethgexecutable(pycompat.fsencode(exe))
return _hgexecutable
def _sethgexecutable(path):