forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed as duplicate of#23799
Labels
triage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
Description
Describe the bug
The debugger loads trailing comments when loading env variables form .env file
To Reproduce
Create .env file and test.py file
# .env
TEST_VAR = test # This comment will show up# test.py
import os
from dotenv import load_dotenv
load_dotenv()
print(os.getenv("TEST_VAR"))
# python prints 'test'
# debugger prints 'test # This comment will show up'Run the file, once with python, once using debugger
python -m venv venv && source venv/bin/activate && pip install python-dotenv
python test.pywhen running with python the output looks like this:
testwhen running with debugger the output looks like this:
test # This comment will show upExpected behavior
The comment from .env file shouldn't be read as a part of variable when using the debugger
Environment:
- OS: Ubuntu 22.04
- Python: 3.12.2
- Extension version: 2024.15.2024121701
Metadata
Metadata
Assignees
Labels
triage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team