Repository navigation
Fix legacy resolver dropping .exe suffix on Windows - #1151
Open
Debojyoti De Majumder (debojyoti10CC) wants to merge 1 commit into
Open
Debojyoti De Majumder (debojyoti10CC) wants to merge 1 commit into
Debojyoti De Majumder (debojyoti10CC) wants to merge 1 commit into
Conversation
Restore the .exe suffix when the Python extension returns an extensionless interpreter path that does not exist but <path>.exe does.
Author
|
@microsoft-github-policy-service agree |
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.
Fixes #1136
What was wrong
On Windows, with Python Environments disabled, the legacy resolver path returned
.venv\Scripts\pythoninstead of.venv\Scripts\python.exe. That file doesn't exist, so the debug adapter couldn't launch and "Debug Test" showed the test as skipped.Fix
Added
restoreWindowsExeSuffix(src/extension/common/executablePath.ts). On win32, if the path has no extension, doesn't exist, and<path>.exedoes, it returns the.exepath. It is applied inlegacyResolveEnvironmentandlegacyGetInterpreterDetails. Other platforms and existing paths are unchanged.Testing
New unit tests in
executablePath.unit.test.ts, run with mocha directly (I did not run the full VS Code-hosted suite)..exe): 4 passing, 1 failingtsc --noEmit, prettier and ESLint are clean on the changed files.I haven't reproduced the full debug-session flow in VS Code.