Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when autoloading env var with equals sign (=) in its value in a virtual env #23038

Closed
natanmoraes opened this issue Mar 7, 2024 · 2 comments
Assignees
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@natanmoraes
Copy link

Type: Bug

Behaviour

Expected vs. Actual

Expected: If I have an environment variable with an equals sign (=) character in its value and a virtual environment is active, I expect its value to not change when loaded by the vscode terminal

Actual: When the .env file is loaded, for each variable that has an equals sign (=) in its value, the value is "cropped" right before the first instance of the equals sign.

For example a connection string variable for azure cosmos would be something like:
COSMOS_NOSQL_URL="AccountEndpoint=https://localhost:8081/;AccountKey=......
After the autoloading, if I run echo $COSMOS_NOSQL_URL the returned value is only AccountEndpoint

Steps to reproduce:

  1. Create a project with a .env file in its root directory with a variable with an equals sign (=) somewhere in its value
  2. Create a virtual environment for the new project and open it on vscode
  3. Make sure the config python.envFile is set to ${workspaceFolder}/.env
  4. Open a new terminar in vscode and run echo $<your variable name> and observe the output

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.12.1
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Pyenv
  • Value of the python.languageServer setting: Default
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

User Settings


languageServer: "Pylance"

testing
• unittestEnabled: true

Extension version: 2024.2.1
VS Code version: Code 1.87.0 (019f4d1419fbc8219a181fab7892ebccf7ee29a2, 2024-02-27T23:42:16.599Z)
OS version: Linux x64 6.5.0-21-generic
Modes:

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Mar 7, 2024
@natanmoraes
Copy link
Author

Screenshots

image

image

@karrtikr
Copy link

Closing as duplicate of microsoft/vscode#197603, we encourage you interact with that issue to raise priority.

@karrtikr karrtikr closed this as not planned Won't fix, can't repro, duplicate, stale Mar 11, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants