Patchwork [1,of,2] run-tests: partially backout PYTHON quoting

login
register
mail settings
Submitter Matt Harbison
Date Sept. 21, 2018, 5:03 a.m.
Message ID <1b0ca924a1c3de80bf3b.1537506184@Envy>
Download mbox | patch
Permalink /patch/34887/
State Accepted
Headers show

Comments

Matt Harbison - Sept. 21, 2018, 5:03 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1537501530 14400
#      Thu Sep 20 23:45:30 2018 -0400
# Node ID 1b0ca924a1c3de80bf3b2b3efcf0f82b2815b4d7
# Parent  7303ab86431a09f85f19606f932a645f6999ec24
run-tests: partially backout PYTHON quoting

In 7f8b7a060584, I quoted this to support python being installed to
"Program Files".  Even though the string passed to os.popen() is this:

    "c:/Python27/python.exe" -c "import mercurial; print (mercurial.__path__[0])"

... cmd.exe is trying to run this:

    'c:/Python27/python.exe" -c "import'

This caused test-hghave.t to fail, reporting 'unexpected mercurial lib: ""',
because the failed execution prints nothing to stdout.  Py3 fails as though it's
not quoted.  For whatever reason, print() shows up in the output when run with
py2, but not py3, so I'm having a hard time debugging this.  For now, let's fix
the buildbot.
Yuya Nishihara - Sept. 21, 2018, 11:20 a.m.
On Fri, 21 Sep 2018 01:03:04 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1537501530 14400
> #      Thu Sep 20 23:45:30 2018 -0400
> # Node ID 1b0ca924a1c3de80bf3b2b3efcf0f82b2815b4d7
> # Parent  7303ab86431a09f85f19606f932a645f6999ec24
> run-tests: partially backout PYTHON quoting

Queued this, thanks.

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -3082,7 +3082,7 @@  class TestRunner(object):
         if self._hgpath is not None:
             return self._hgpath
 
-        cmd = b'"%s" -c "import mercurial; print (mercurial.__path__[0])"'
+        cmd = b'%s -c "import mercurial; print (mercurial.__path__[0])"'
         cmd = cmd % PYTHON
         if PYTHON3:
             cmd = _strpath(cmd)