-
Notifications
You must be signed in to change notification settings - Fork 73
Open
Labels
info-neededIssue requires more information from posterIssue requires more information from postertriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
Description
Description
Using envFile in launch.json file to load env variables from .env file does not load full variable which have multi line.
Environment Information
- Python Debugger extension versions
2025.14.1
Example code
import os
variable = os.getenv("EXAMPLE_VAR")
print("EXAMPLE_VAR:", variable)
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Debug single file",
"request": "launch",
"type": "debugpy",
"program": "${file}",
"console": "integratedTerminal",
"envFile": "${workspaceFolder}/example.env"
}
]
}
example.env
EXAMPLE_VAR='very long value
with new line , we need to get all the lines'
Output
EXAMPLE_VAR: 'very long value
Expected output
EXAMPLE_VAR: very long value
with new line , we need to get all the lines
Using load_dotenv to load .env work as expected
import os
from dotenv import load_dotenv
load_dotenv(dotenv_path="example.env")
variable = os.getenv("EXAMPLE_VAR")
print("EXAMPLE_VAR:", variable)
## Output
EXAMPLE_VAR: very long value
with new line , we need to get all the lines
Result with env load from launch.json
Result with env load from load_dotenv

Metadata
Metadata
Assignees
Labels
info-neededIssue requires more information from posterIssue requires more information from postertriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team