diff mercurial/scmutil.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 b63dee7bd0d9
children f1d6021453c2
line wrap: on
line diff
--- a/mercurial/scmutil.py	Fri Sep 21 21:14:27 2018 -0400
+++ b/mercurial/scmutil.py	Sun Sep 23 00:47:04 2018 -0400
@@ -1339,9 +1339,11 @@
         if spec.startswith("shell:"):
             # external commands should be run relative to the repo root
             cmd = spec[6:]
-            proc = subprocess.Popen(cmd, shell=True, bufsize=-1,
+            proc = subprocess.Popen(pycompat.rapply(procutil.tonativestr, cmd),
+                                    shell=True, bufsize=-1,
                                     close_fds=procutil.closefds,
-                                    stdout=subprocess.PIPE, cwd=repo.root)
+                                    stdout=subprocess.PIPE,
+                                    cwd=procutil.tonativestr(repo.root))
             src = proc.stdout
         else:
             # treat as a URL or file