summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_launcher.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-05-29 20:06:38 (GMT)
committerGitHub <noreply@github.com>2024-05-29 20:06:38 (GMT)
commitc3cfc04a736111cb61883cef08469ea46f86d9ce (patch)
tree75f72ec6beb5a13c0b6fd7651591ce5eba95e587 /Lib/test/test_launcher.py
parentdcfbd3be9f1e0ba7aa32214e8f5f7f2ea4375a28 (diff)
downloadcpython-c3cfc04a736111cb61883cef08469ea46f86d9ce.zip
cpython-c3cfc04a736111cb61883cef08469ea46f86d9ce.tar.gz
cpython-c3cfc04a736111cb61883cef08469ea46f86d9ce.tar.bz2
gh-119070: Fix py.exe handling of /usr/bin/env commands missing extension (GH-119426)
(cherry picked from commit df93f5d4bf9d70036d485666d4dd4f009d37f8b9) Co-authored-by: Steve Dower <steve.dower@python.org>
Diffstat (limited to 'Lib/test/test_launcher.py')
-rw-r--r--Lib/test/test_launcher.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_launcher.py b/Lib/test/test_launcher.py
index 2528a51..6d358ac 100644
--- a/Lib/test/test_launcher.py
+++ b/Lib/test/test_launcher.py
@@ -764,3 +764,11 @@ class TestLauncher(unittest.TestCase, RunPyMixin):
with self.script(f'#! /usr/bin/env {exe.stem} arg1') as script:
data = self.run_py([script], env=env)
self.assertEqual(data["stdout"].strip(), f"{quote(exe)} arg1 {quote(script)}")
+
+ def test_shebang_executable_extension(self):
+ with self.script('#! /usr/bin/env python3.12') as script:
+ data = self.run_py([script])
+ expect = "# Search PATH for python3.12.exe"
+ actual = [line.strip() for line in data["stderr"].splitlines()
+ if line.startswith("# Search PATH")]
+ self.assertEqual([expect], actual)