From 90c8d754b73fe9604634789eb32947198587240b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Thu, 17 May 2018 15:10:11 +0200 Subject: [PATCH] [testsuite] Call subprocess.Popen() with shell=True on Windows --- tests/system_tests.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/system_tests.py b/tests/system_tests.py index 644f6093..8dc30d01 100644 --- a/tests/system_tests.py +++ b/tests/system_tests.py @@ -13,6 +13,9 @@ import unittest if sys.platform == 'win32': + #: invoke subprocess.Popen with shell=True on Windows + _SUBPROCESS_SHELL = True + def _cmd_splitter(cmd): return cmd @@ -20,6 +23,9 @@ if sys.platform == 'win32': return output.replace('\r\n', '\n') else: + #: invoke subprocess.Popen with shell=False on Unix + _SUBPROCESS_SHELL = False + def _cmd_splitter(cmd): return shlex.split(cmd) @@ -503,7 +509,8 @@ def test_run(self): _cmd_splitter(command), stdout=subprocess.PIPE, stderr=subprocess.PIPE, - cwd=self.work_dir + cwd=self.work_dir, + shell=_SUBPROCESS_SHELL ) def timeout_reached(timeout):