fix(windows): handle multiple Python interpreters in Resolve-ODSHostAgentPython#1665
Open
IronicRayquaza wants to merge 1 commit into
Open
Conversation
…preters Get-Command returns an array when multiple executables share a name across PATH entries. Accessing .Source directly on an array throws ParameterBindingArgumentTransformationException, crashing the installer on dev machines with venv + global Python + Microsoft Store alias. Wrap all Get-Command calls in @() in Resolve-ODSHostAgentPython so .Source is always accessed on a single ApplicationInfo object. Fixes both 07-devtools.ps1 (active installer) and ods.ps1 (same pattern). Closes Osmantic#1654
Collaborator
|
Thanks for fixing the Windows host-agent Python resolver in both the install-time and post-install paths; that is the right scope for the multiple-interpreter failure. Advisory status: looks merge-ready What looks good:
What I checked:
Thanks again for covering both active resolver copies. |
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
On dev machines with multiple Python executables on PATH (venv + global
install + Microsoft Store alias), Get-Command returns an array instead
of a single ApplicationInfo object. Accessing .Source directly on that
array throws ParameterBindingArgumentTransformationException, crashing
the installer at Phase 07.
Closes #1654
Changes
ods/installers/windows/phases/07-devtools.ps1— wrapped bothGet-Command calls in @() inside Resolve-ODSHostAgentPython so .Source
is always accessed on a single object per iteration
ods/installers/windows/ods.ps1— applied the identical fix to thesame function (noted but not patched by the reporter)
Testing
bash -npasses on all changed files