Fix log message to correctly reference invalid venv environment not conda#788
Merged
eleanorjboyd merged 2 commits intomainfrom Sep 5, 2025
Merged
Conversation
…onda Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update Reference for Invalid Virtual Environment
Fix log message to correctly reference invalid venv environment not conda
Sep 4, 2025
eleanorjboyd
approved these changes
Sep 4, 2025
rzhao271
approved these changes
Sep 4, 2025
hediet
approved these changes
Sep 5, 2025
NguyenCuong1989
referenced
this pull request
in NguyenCuong1989/vscode-python-environments
Oct 23, 2025
…onda (#788)
## Problem
The `findVirtualEnvironments` function in
`src/managers/builtin/venvUtils.ts` was logging misleading warning
messages. When encountering an invalid virtual environment (missing
prefix, executable, or version), it would log:
```
Invalid conda environment: {...}
```
However, this function is specifically designed to find and process
**venv** environments, not conda environments. The function correctly
filters for `NativePythonEnvironmentKind.venv` on line 179, making the
conda reference in the warning message incorrect and confusing for
developers debugging environment discovery issues.
## Solution
Updated the warning message on line 183 to accurately reflect the
environment type being processed:
```typescript
// Before
log.warn(`Invalid conda environment: ${JSON.stringify(e)}`);
// After
log.warn(`Invalid venv environment: ${JSON.stringify(e)}`);
```
## Impact
This change provides accurate debugging information when invalid venv
environments are encountered, making it easier for developers and users
to understand which type of environment manager is reporting the issue.
The fix is minimal and surgical, changing only the log message text
without affecting any functionality.
All existing tests continue to pass, confirming that this change doesn't
introduce any regressions.
<!-- START COPILOT CODING AGENT SUFFIX -->
Created from VS Code via the [GitHub Pull
Request](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github)
extension.
<!-- START COPILOT CODING AGENT TIPS -->
---
✨ Let Copilot coding agent [set things up for
you](https://github.com/microsoft/vscode-python-environments/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
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.
Problem
The
findVirtualEnvironmentsfunction insrc/managers/builtin/venvUtils.tswas logging misleading warning messages. When encountering an invalid virtual environment (missing prefix, executable, or version), it would log:However, this function is specifically designed to find and process venv environments, not conda environments. The function correctly filters for
NativePythonEnvironmentKind.venvon line 179, making the conda reference in the warning message incorrect and confusing for developers debugging environment discovery issues.Solution
Updated the warning message on line 183 to accurately reflect the environment type being processed:
Impact
This change provides accurate debugging information when invalid venv environments are encountered, making it easier for developers and users to understand which type of environment manager is reporting the issue. The fix is minimal and surgical, changing only the log message text without affecting any functionality.
All existing tests continue to pass, confirming that this change doesn't introduce any regressions.
Created from VS Code via the GitHub Pull Request extension.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.