Skip to content

Commit ee805a9

Browse files
authored
Merge pull request #99 from testing-cabal/exec-permissions
Fix handling of executability bit for sample scripts
2 parents a08695d + f1ba01a commit ee805a9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

python/subunit/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,12 @@ def debug(self):
913913

914914
def _run(self, result):
915915
protocol = TestProtocolServer(result)
916-
process = subprocess.Popen(self.script, shell=True, stdout=subprocess.PIPE)
916+
# Explicitly invoke Python to run the script instead of relying on
917+
# execute permissions, which may not be preserved during installation
918+
import shlex
919+
920+
script_parts = shlex.split(self.script)
921+
process = subprocess.Popen([sys.executable] + script_parts, stdout=subprocess.PIPE)
917922
make_stream_binary(process.stdout)
918923
output = process.communicate()[0]
919924
protocol.readFrom(BytesIO(output))

0 commit comments

Comments
 (0)