-
Notifications
You must be signed in to change notification settings - Fork 39.2k
Environment collection replace API strips equals sign at the end #197603
Copy link
Copy link
Closed
Copy link
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugterminalGeneral terminal issues that don't fall under another labelGeneral terminal issues that don't fall under another labelterminal-shell-bashAn issue in the terminal specific to bash, including shell integrationAn issue in the terminal specific to bash, including shell integrationterminal-shell-fishAn issue in the terminal specific to fish, including shell integrationAn issue in the terminal specific to fish, including shell integrationterminal-shell-integrationShell integration infrastructure, command decorations, etc.Shell integration infrastructure, command decorations, etc.terminal-shell-pwshAn issue in the terminal specific to PowerShell, including shell integrationAn issue in the terminal specific to PowerShell, including shell integrationverifiedVerification succeededVerification succeeded
Milestone
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugterminalGeneral terminal issues that don't fall under another labelGeneral terminal issues that don't fall under another labelterminal-shell-bashAn issue in the terminal specific to bash, including shell integrationAn issue in the terminal specific to bash, including shell integrationterminal-shell-fishAn issue in the terminal specific to fish, including shell integrationAn issue in the terminal specific to fish, including shell integrationterminal-shell-integrationShell integration infrastructure, command decorations, etc.Shell integration infrastructure, command decorations, etc.terminal-shell-pwshAn issue in the terminal specific to PowerShell, including shell integrationAn issue in the terminal specific to PowerShell, including shell integrationverifiedVerification succeededVerification succeeded
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"]