Repository navigation
Prepend noConfigScripts directory to PATH so bundled debugpy wrapper wins - #1148
Open
TEJA P C (PCTEJA) wants to merge 1 commit into
Open
TEJA P C (PCTEJA) wants to merge 1 commit into
TEJA P C (PCTEJA) wants to merge 1 commit into
Conversation
…wins Since debugpy 1.8.5, the debugpy Python package installs its own debugpy command. The extension appended the noConfigScripts directory to the end of the integrated terminal PATH, so a user-installed debugpy package shadowed the bundled wrapper and 'debugpy script.py' ran the wrong command. Prepend the directory (with its trailing separator) instead, and update the unit tests that asserted the append behaviour. Fixes microsoft#931
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.
Summary
Fixes #931.
Since debugpy 1.8.5, the
debugpyPython package installs its owndebugpycommand. The extension appended thenoConfigScriptsdirectory (which holds the bundleddebugpywrapper) to the end of the integrated terminal'sPATH, so a user-installed debugpy package shadows the bundled wrapper anddebugpy script.pyin the terminal runs the wrong command.Change
In
registerNoConfigDebug(src/extension/noConfigDebugInit.ts), prepend the directory instead of appending it:VS Code's
prependimplementation concatenatesvalue + existingValueand adds no separator itself, so the value carries the trailing separator (;on Windows,:elsewhere) — the mirror of the previous leading-separator fix for the concatenation regression (#843/#1011), which this preserves.The two unit tests that asserted the append behaviour now assert
prependwith the value${noConfigScriptsDir}${pathSeparator}.Testing
npm run compile-tests(tsc) passes;eslintandprettier --checkpass on both changed files.environmentVariableCollectionimplementation, verified the changed logic across Windows/POSIX and populated/empty/unset PATH combinations, and confirmed no other code in the repo adds this directory to PATH.debugpywrapper scripts, so no unrelated command is shadowed.This change was prepared with AI assistance (Muse, validated with Codex); I have reviewed every changed line and take responsibility for it.