# HG changeset patch # User Augie Fackler # Date 2018-01-18 00:11:51 # Node ID 4be991331a46c657544c7915d926cff2661e33a2 # Parent 4269971b0d26b8f23c128a3f661245ae2e32f0fe tests: get run-tests to reliably hand shellquote a string and not a bytes Differential Revision: https://phab.mercurial-scm.org/D1883 diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -1341,7 +1341,11 @@ class TTest(Test): if os.getenv('MSYSTEM'): script.append(b'alias pwd="pwd -W"\n') if self._case: - script.append(b'TESTCASE=%s\n' % shellquote(self._case)) + if isinstance(self._case, str): + quoted = shellquote(self._case) + else: + quoted = shellquote(self._case.decode('utf8')).encode('utf8') + script.append(b'TESTCASE=%s\n' % quoted) script.append(b'export TESTCASE\n') n = 0