diff hgext/fix.py @ 39826: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 a009589cd32a
children f1d6021453c2
line wrap: on
line diff
--- a/hgext/fix.py	Fri Sep 21 21:14:27 2018 -0400
+++ b/hgext/fix.py	Sun Sep 23 00:47:04 2018 -0400
@@ -58,6 +58,10 @@
 from mercurial.node import nullrev
 from mercurial.node import wdirrev
 
+from mercurial.utils import (
+    procutil,
+)
+
 from mercurial import (
     cmdutil,
     context,
@@ -448,9 +452,9 @@
                 continue
             ui.debug('subprocess: %s\n' % (command,))
             proc = subprocess.Popen(
-                command,
+                pycompat.rapply(procutil.tonativestr, command),
                 shell=True,
-                cwd='/',
+                cwd=procutil.tonativestr(b'/'),
                 stdin=subprocess.PIPE,
                 stdout=subprocess.PIPE,
                 stderr=subprocess.PIPE)