mercurial/subrepo.py
changeset 39826 c31ce080eb75
parent 39547 41ac8ea1bdd7
child 40342 6f152067ba57
--- 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