Commit 33697c0
authored
Always quote Python executable path (#964)
* Always quote Python executable path
On Windows, this would cause pahts like "C:\Program Files\" to fail launching the Python command as the blank space was not escaped properly.
Add also a unit test to validate this change.
Signed-off-by: Francesco Giancane <me@fgiancane8.dev>
* stringUtils.ts: remove call to .replace() method for paths
There is no need anymore to replace backslashes with forward slashes
for paths on Windows, as the Python extension's
`toCommandArgumentForPythonExt` function already handles this correctly.
Signed-off-by: Francesco Giancane <me@fgiancane8.dev>
* stringUtils.ts: restore replace call when normalizing string
* remoteLaunchers: ensure test is normalizing paths
Explicitly call `fileToCommandArgumentForPythonExt` when computing a path with spaces and check results are as expected.
* stringUtils.ts: replace backslashes with forward-slashes only on non-Windows platforms.
* Revert "remoteLaunchers: ensure test is normalizing paths"
This reverts commit 32822e0.
* remoteLaunchers.ts: feed platform-specific data to tests
Use backward slashes on Windows and forward slashes on Unix-like OSes when testing correct behavior of path strings quotation.
* Copy-paste error in comment.
* remoteLaunchers.unit.test.ts: fix formatting issues
---------
Signed-off-by: Francesco Giancane <me@fgiancane8.dev>1 parent e0ec60c commit 33697c0
File tree
4 files changed
+41
-5
lines changed- src
- extension
- common
- debugger/adapter
- test/unittest/adapter
4 files changed
+41
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
61 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
62 | 71 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
83 | 90 | | |
84 | 91 | | |
85 | 92 | | |
86 | 93 | | |
87 | 94 | | |
88 | 95 | | |
89 | 96 | | |
90 | | - | |
91 | 97 | | |
92 | 98 | | |
93 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
308 | 324 | | |
309 | 325 | | |
310 | 326 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
14 | 19 | | |
15 | 20 | | |
16 | 21 | | |
17 | | - | |
| 22 | + | |
18 | 23 | | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
22 | | - | |
| 27 | + | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
| |||
0 commit comments