diff --git a/mercurial/utils/procutil.py b/mercurial/utils/procutil.py --- a/mercurial/utils/procutil.py +++ b/mercurial/utils/procutil.py @@ -640,7 +640,7 @@ # we can't use close_fds *and* redirect stdin. I'm not sure that we # need to because the detached process has no console connection. p = subprocess.Popen( - tonativestr(script), + pycompat.rapply(tonativestr, script), shell=shell, env=tonativeenv(env), close_fds=True,