[PATCH] py3: teach run-tests.py to handle exe with spaces when --local isn't specified

Matt Harbison mharbison72 at gmail.com
Thu Dec 13 08:04:28 EST 2018


> On Dec 13, 2018, at 6:34 AM, Yuya Nishihara <yuya at tcha.org> wrote:
> 
>> On Thu, 13 Dec 2018 00:24:41 -0500, Matt Harbison wrote:
>> # HG changeset patch
>> # User Matt Harbison <matt_harbison at yahoo.com>
>> # Date 1544678327 18000
>> #      Thu Dec 13 00:18:47 2018 -0500
>> # Node ID bf9c96ebceeab2cbad25b2aac07c43eb48fbc664
>> # Parent  008f3491dc5377e9e6f210e0a3f161323049db5d
>> py3: teach run-tests.py to handle exe with spaces when --local isn't specified
> 
>> -        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)
>> -        pipe = os.popen(cmd)
>> -        try:
>> -            self._hgpath = _bytespath(pipe.read().strip())
>> -        finally:
>> -            pipe.close()
>> +
>> +        p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
> 
> Added missing shell=True. Otherwise, the test runner would just fail.

Are we missing test coverage, or is that a Unix problem in this case?  This was a last minute change after running everything, but it was able to run test-hghave.t.



More information about the Mercurial-devel mailing list