From patchwork Thu Sep 20 12:09:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1,of,3] run-tests: quote PYTHON when spawning a subprocess From: Matt Harbison X-Patchwork-Id: 34842 Message-Id: <4d2a7291137d1fc1ac8a.1537445399@Envy> To: mercurial-devel@mercurial-scm.org Date: Thu, 20 Sep 2018 08:09:59 -0400 # HG changeset patch # User Matt Harbison # Date 1537404357 14400 # Wed Sep 19 20:45:57 2018 -0400 # Node ID 4d2a7291137d1fc1ac8ac32862a1d3593f3eb10e # Parent 6a29fe518906d0f21b7bdd76323d2f71e7667241 run-tests: quote PYTHON when spawning a subprocess Same reason as 5abc47d4ca6b. This covers running *.py tests, as well as inline python blocks. I didn't hit the path around line 3079, but it seems correct to quote. diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -1213,7 +1213,8 @@ class PythonTest(Test): def _run(self, env): py3kswitch = self._py3kwarnings and b' -3' or b'' - cmd = b'%s%s "%s"' % (PYTHON, py3kswitch, self.path) + + cmd = b'"%s" %s "%s"' % (PYTHON, py3kswitch, self.path) vlog("# Running", cmd) normalizenewlines = os.name == 'nt' result = self._runcommand(cmd, env, @@ -1475,7 +1476,7 @@ class TTest(Test): # We've just entered a Python block. Add the header. inpython = True addsalt(prepos, False) # Make sure we report the exit code. - script.append(b'%s -m heredoctest <