D6775: py3: convert hg executable path to bytes in missing case in procutil

Yuya Nishihara yuya at tcha.org
Sat Aug 31 22:53:45 EDT 2019


> --- a/mercurial/utils/procutil.py
> +++ b/mercurial/utils/procutil.py
> @@ -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))

Perhaps, `pycompat.sysargv` has to be used instead. Applying `fsencode()`
on `sys.argv` might be incorrect on Windows.


More information about the Mercurial-devel mailing list