| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -764,3 +764,11 @@ def test_shebang_command_in_venv(self): | |||
| 764 | 764 | with self.script(f'#! /usr/bin/env {exe.stem} arg1') as script: | |
| 765 | 765 | data = self.run_py([script], env=env) | |
| 766 | 766 | self.assertEqual(data["stdout"].strip(), f"{quote(exe)} arg1 {quote(script)}") | |
| 767 | + | ||
| 768 | + def test_shebang_executable_extension(self): | ||
| 769 | + with self.script('#! /usr/bin/env python3.12') as script: | ||
| 770 | + data = self.run_py([script]) | ||
| 771 | + expect = "# Search PATH for python3.12.exe" | ||
| 772 | + actual = [line.strip() for line in data["stderr"].splitlines() | ||
| 773 | + if line.startswith("# Search PATH")] | ||
| 774 | + self.assertEqual([expect], actual) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,3 @@ | |||
| 1 | + Fixes ``py.exe`` handling of shebangs like ``/usr/bin/env python3.12``, | ||
| 2 | + which were previously interpreted as ``python3.exe`` instead of | ||
| 3 | + ``python3.12.exe``. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -853,7 +853,7 @@ searchPath(SearchInfo *search, const wchar_t *shebang, int shebangLength) | |||
| 853 | 853 | } | |
| 854 | 854 | ||
| 855 | 855 | wchar_t filename[MAXLEN]; | |
| 856 | - if (wcsncpy_s(filename, MAXLEN, command, lastDot)) { | ||
| 856 | + if (wcsncpy_s(filename, MAXLEN, command, commandLength)) { | ||
| 857 | 857 | return RC_BAD_VIRTUAL_PATH; | |
| 858 | 858 | } | |
| 859 | 859 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments