Mercurial > public > mercurial-scm > hg-stable
diff mercurial/subrepo.py @ 39831:c31ce080eb75
py3: convert arguments, cwd and env to native strings when spawning subprocess
This keeps Windows happy.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 23 Sep 2018 00:47:04 -0400 |
parents | 41ac8ea1bdd7 |
children | 6f152067ba57 |
line wrap: on
line diff
--- a/mercurial/subrepo.py Fri Sep 21 21:14:27 2018 -0400 +++ b/mercurial/subrepo.py Sun Sep 23 00:47:04 2018 -0400 @@ -951,9 +951,11 @@ env['LANG'] = lc_all del env['LC_ALL'] env['LC_MESSAGES'] = 'C' - p = subprocess.Popen(cmd, bufsize=-1, close_fds=procutil.closefds, + p = subprocess.Popen(pycompat.rapply(procutil.tonativestr, cmd), + bufsize=-1, close_fds=procutil.closefds, stdout=subprocess.PIPE, stderr=subprocess.PIPE, - universal_newlines=True, env=env, **extrakw) + universal_newlines=True, + env=procutil.tonativeenv(env), **extrakw) stdout, stderr = p.communicate() stderr = stderr.strip() if not failok: @@ -1268,8 +1270,12 @@ # insert the argument in the front, # the end of git diff arguments is used for paths commands.insert(1, '--color') - p = subprocess.Popen([self._gitexecutable] + commands, bufsize=-1, - cwd=cwd, env=env, close_fds=procutil.closefds, + p = subprocess.Popen(pycompat.rapply(procutil.tonativestr, + [self._gitexecutable] + commands), + bufsize=-1, + cwd=pycompat.rapply(procutil.tonativestr, cwd), + env=procutil.tonativeenv(env), + close_fds=procutil.closefds, stdout=subprocess.PIPE, stderr=errpipe) if stream: return p.stdout, None