Skip to content

envFile configuration wrongly includes a trailing comment in environment variable value #875

@Magicbeanbuyer

Description

@Magicbeanbuyer

Description

I defined an environment variable with a trailing comment in my .env file.

FOO=bar  # trailing comment

When debugging the following python module.

import os

foo = os.getenv("FOO")
print(foo)

foo gets value bar # trailing comment, the expected behaviour is foo has value bar.

Image

Version

I am using MacOS and I have the following extensions:

Name: Python Environments
Id: ms-python.vscode-python-envs
Description: Provides a unified python environment experience
Version: 1.12.0
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-python-envs
Name: Python Debugger
Id: ms-python.debugpy
Description: Python Debugger extension using debugpy.
Version: 2025.16.0
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.debugpy

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage-neededNeeds assignment to the proper sub-team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions