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

.env file not parsed properly #23453

Closed
juha-ylikoski opened this issue May 20, 2024 · 4 comments
Closed

.env file not parsed properly #23453

juha-ylikoski opened this issue May 20, 2024 · 4 comments
Assignees
Labels
info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team

Comments

@juha-ylikoski
Copy link

Type: Bug

This extension will try to load (by default) .env named file (setting ID: python.envFile). This file is not properly parsed.

Steps to reproduce

  1. create file .env with content:
KEY="subkey1=subvalue1,subkey2=subvalue2"
  1. Select a python interpreter (not sure if necessary)
  2. Open a new integrated terminal (terminal>>new terminal). This opens a new terminal and uses the selected python interpreter there as env (e.g. with .venv sources the activate from the .venv folder)
  3. run
$ echo $KEY
subkey1

This prints only the first part of the value of the "KEY" environment variable

Expected behavior

Environment variable should be parsed as bash and others parse them. This should cause it to be "subkey1=subvalue1,subkey2=subvalue2"


Extension version: 2024.4.1
VS Code version: Code 1.87.1 (1e790d77f81672c49be070e04474901747115651, 2024-03-06T00:21:07.287Z)
OS version: Linux x64 6.5.11-060511-generic
Modes:
Remote OS version: Linux x64 6.5.11-060511-generic
Remote OS version: Linux x64 6.5.11-060511-generic

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label May 20, 2024
@anthonykim1
Copy link

Thank you for filing this issue! Will investigate this

@anthonykim1
Copy link

@juha-ylikoski I'm wondering if this is related to #22982
Can you try adding:
"python.experiments.optOutFrom": ["pythonTerminalEnvVarActivation"] to your settings.json and see if that works?

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jun 25, 2024
@juha-ylikoski
Copy link
Author

@anthonykim1 I do not seem to be able to reproduce the original bug anymore... Seems that my extension version was updated to 2024.8.1 but after downgrading back to 2024.4.1 I'm still not able to reproduce.

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Jun 26, 2024
@anthonykim1
Copy link

Great, glad to hear.
Please feel free free to reopen/ file issue when you encounter a problem

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jun 26, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants