changeset 35863:4be991331a46

tests: get run-tests to reliably hand shellquote a string and not a bytes Differential Revision: https://phab.mercurial-scm.org/D1883
author Augie Fackler <augie@google.com>
date Wed, 17 Jan 2018 19:11:51 -0500
parents 4269971b0d26
children 011ca2d795d6
files tests/run-tests.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Thu Feb 01 14:59:38 2018 -0500
+++ b/tests/run-tests.py	Wed Jan 17 19:11:51 2018 -0500
@@ -1341,7 +1341,11 @@
         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