Repository navigation
fix: do not pass redundant quotes to script path in executeUsingExtension (#26274) - #26276
Merged
Eduardo Villalpando Mello (edvilme) merged 3 commits intoNov 16, 2026
Conversation
Eduardo Villalpando Mello (edvilme)
requested a balanced review from Copilot
November 12, 2026 23:47
|
Thank you very much for taking on this, changes look good and reasonable to me. I will let the tests run and let you know if there are any news! Thanks! |
Eduardo Villalpando Mello (edvilme)
previously approved these changes
Nov 12, 2026
Eduardo Villalpando Mello (edvilme)
approved these changes
Nov 13, 2026
Eduardo Villalpando Mello (edvilme)
enabled auto-merge (squash)
November 13, 2026 23:33
Bill Schnurr (bschnurr)
approved these changes
Nov 16, 2026
Stella Huang (StellaHuang95)
approved these changes
Nov 16, 2026
Eduardo Villalpando Mello (edvilme)
merged commit Nov 16, 2026
50cde3d
into
microsoft:main
52 checks passed
|
Hello MOHAMMED WASIM KHAN (@wasim-builds) Thank you very much for taking the time to work on this and addressing the bug. Changes look good :) |
Author
|
Eduardo Villalpando Mello (@edvilme) thank you for appreciation, is there any way to join the organisation and work , if there any opportunities please let me know it will be very helpful for me , once again thank you |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #26274
Also resolves the underlying issue reported upstream in microsoft/vscode#346333.
When "Run Python File" or "Run Python File in Dedicated Terminal" executes via the Python Environments extension API (
extapi.runInTerminalorextapi.runInDedicatedTerminal),PythonTerminalExecutionOptions.argsexpects raw arguments and handles necessary shell quoting internally.Previously,
executeUsingExtensioninsrc/client/terminals/codeExecution/codeExecutionManager.tsappendedfileToExecute.fsPath.fileToCommandArgumentForPythonExt()tototalArgs. For script paths containing spaces (e.g./path with spaces/main.py),fileToCommandArgumentForPythonExt()wrapped the path in literal quotes ("..."). When passed torunInTerminal, the terminal received literal quotes as part of the path, causing Python to fail with[Errno 2] No such file or directoryor[Errno 22] Invalid argument: '"/path with spaces/main.py"'.Changes
src/client/terminals/codeExecution/codeExecutionManager.ts:fileToExecute.fsPathintotalArgsinstead of wrapping withfileToCommandArgumentForPythonExt(), letting the terminal execution API handle argument quoting.src/test/terminals/codeExecution/codeExecutionManager.unit.test.ts:Ensure executeUsingExtension does not pass extra quotes in path with spaces.Ensure executeUsingExtension does not pass extra quotes in path with spaces for dedicated terminal.Verification
npx tsc -p ./passed with 0 errors.npx mocha -r out/test/unittests.js --ui tdd out/test/terminals/codeExecution/codeExecutionManager.unit.test.jspassed all 12 tests.npx eslint src/client/terminals/codeExecution/codeExecutionManager.ts src/test/terminals/codeExecution/codeExecutionManager.unit.test.tspassed with 0 errors and 0 warnings.