Skip to content

Fix legacy resolver dropping .exe suffix on Windows - #1151

Open
Debojyoti De Majumder (debojyoti10CC) wants to merge 1 commit into
microsoft:mainfrom
debojyoti10CC:fix/legacy-resolver-windows-exe
Open

Debojyoti De Majumder (debojyoti10CC) wants to merge 1 commit into
microsoft:mainfrom
debojyoti10CC:fix/legacy-resolver-windows-exe

Conversation

@debojyoti10CC

Copy link
Copy Markdown

Fixes #1136

What was wrong

On Windows, with Python Environments disabled, the legacy resolver path returned .venv\Scripts\python instead 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>.exe does, it returns the .exe path. It is applied in legacyResolveEnvironment and legacyGetInterpreterDetails. 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).

  • Before (helper not restoring .exe): 4 passing, 1 failing
  • After: 5 passing
  • tsc --noEmit, prettier and ESLint are clean on the changed files.

I haven't reproduced the full debug-session flow in VS Code.

Restore the .exe suffix when the Python extension returns an extensionless
interpreter path that does not exist but <path>.exe does.
@debojyoti10CC

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Windows test debugging fails with Python Environments extension disabled: legacy resolver drops .exe suffix from interpreter path

1 participant