Skip to content

launch envFile cannot use the variable ${fileDirname} #522

@snr278

Description

@snr278

Environment data

  • VS Code version: 1.45.1(user setup)
  • Extension version (available under the Extensions sidebar): 2020.5.80290
  • OS and version: Windows_NT x64 10.0.17763
  • Python version (& distribution if applicable, e.g. Anaconda): 2.7.5 64-bit
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): NA
  • Relevant/affected Python packages and their versions: XXX
  • Relevant/affected Python-related VS Code extensions and their versions: XXX
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info How to update the language server to the latest stable version vscode-python#3977): Jedi
  • Value of the python.languageServer setting: Microsoft

Expected behaviour

configurations.envFile can use the variable ${fileDirname} (eg:"envFile": "${fileDirname}/${fileBasenameNoExtension}.env")

Actual behaviour

env variables define in file ${fileDirname}/${fileBasenameNoExtension}.env are not working.

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. create test file ${workspaceFolder}/test/test.py ${workspaceFolder}/test/test.env.
    2.test.env define the env variable TEST_ENV_MY=hello world test_env
    3.test.py print the env variable TEST_ENV_MY
    4.define the envFile in launch.json "envFile": "${fileDirname}/.env"

record

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX


Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

XXXX

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from posterneeds PRReady to be worked on

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions