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.
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Event Timeline
Comment Actions
- 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.
Comment Actions
Sounds reasonable. I'll send a follow-up patch. Feel free to apply it on top of fold it in.