-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Environment collection replace API strips equals sign at the end #197603
Comments
This comment was marked as resolved.
This comment was marked as resolved.
Thanks for the bug report! We investigate issues in order based on priority and severity, which includes the impact it has on your ability to use the extension to do productive work, and the number of people affected. If other users come forward and leave a comment demonstrating they are seeing/reproducing the problem then we will raise this issue's priority. Thanks for understanding and the patience! |
This comment was marked as resolved.
This comment was marked as resolved.
Thanks, I'm able to reproduce it. Looks like an issue with environment collection API in VS Code itself, hence transferring. |
This makes sense as we currently split on For pwsh: vscode/src/vs/workbench/contrib/terminal/browser/media/shellIntegration.ps1 Lines 24 to 47 in 242755e
|
I have this issue too. I noticed if I run my backend server (which takes a secret key from the .env file) in my system terminal it behaves as expected, but if I run it in the vscode terminal it truncates the key after the equals sign in the key. This broke my backend! Please fix this. Thanks. |
I face this issue too. Waiting for fixing. Thanks |
I am having the same issue when the project is setup for a C++ python extension with leak sanitizers. This requires to
|
I am also experiencing this issue with a Django Secret key containing an '=' sign and would appreciate a fix. I can work around it, but it's not ideal since this runs counter to the expected behavior and how the |
This so frustrating. I had my code working perfectly I was testing the whole day and then suddenly it broke. I spent hours figuring it out. |
I'm facing the same issue. Here are some potential clues based on my project: it only occurs in the init constructor for a class. The class is located in a .py that is in a different folder than the .env. The error occurs when the code is invoked from an api endpoint but works fine otherwise. I tried making adjustments by setting the .env path explicitly but no luck. Please help. |
Can confirm that I am also seeing this behavior in the exact same situation. |
Verification steps:
|
This still had an issue for fish shell which should be fixed in #226980 To verify, repeat steps above but for fish. |
verified bash/fish/zsh |
VS Code version: Code - Insiders 1.84.0-insider (35419fc, 2023-10-27T10:41:08.734Z)
OS version: Windows_NT x64 10.0.19045
Try applying these variables using the environment collection API:
Even though screenshot says they're applied as expected:
equal sign is stripped from the end when printing the value:
Original bug report
From a python interpreter
from dotenv import load_dotenv; import os
with open(".env", "r") as f:
f.readlines()
os.getenv("TEST_KEY")
os.getenv("TEST_KEY_2")
os.getenv("TEST_KEY_3")
os.getenv("TEST_KEY_4")
This may print out SOMETHING in all 4 cases, without the = sign
Repeat after deactivating the environment variable loading from the Python extension and see the = sign for TEST_KEY_2, TEST_KEY_3 and TEST_KEY_4
envFile: ""
venvPath: ""
venvFolders: ""
languageServer: "Pylance"
testing
• unittestEnabled: true
experiments
• optInto: ["pythonTerminalEnvVarActivation"]
The text was updated successfully, but these errors were encountered: