Skip to content

Python / envFile in launch.json causes issues #149

Closed

Description

From @weinand on July 19, 2017 18:50

From @blitzd on July 19, 2017 18:13

  • VSCode Version: Code 1.14.1 (2648980a697a4c8fb5777dcfb2ab110cec8a2f58, 2017-07-13T19:12:01.887Z)
  • OS Version: Linux x64 4.8.0-53-generic
  • Extensions:
Extension Author (truncated) Version
vscode-docker Pet 0.0.16
gitignore cod 0.5.0
githistory don 0.2.1
python don 0.6.7
gitlens eam 4.3.1
vscode-npm-script eg2 0.2.0
MagicPython mag 1.0.10
debugger-for-chrome msj 3.1.6
remote-vscode raf 1.1.0
vscode-icons rob 7.10.1

(1 theme extensions excluded)


Steps to Reproduce:

  1. Create a simple project with a Python launch.json configuration:

launch.json

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Python",
      "type": "python",
      "request": "launch",
      "stopOnEntry": false,
      "pythonPath": "${config:python.pythonPath}",
      "program": "${file}",
      "cwd": "${workspaceRoot}",
      "env": {},
      "envFile": "${workspaceRoot}/.env",
      "debugOptions": [
        "WaitOnAbnormalExit",
        "WaitOnNormalExit",
        "RedirectOutput"
      ],
      "console": "integratedTerminal"
    }
  ]
}

script.py

print('This is a test')
  1. Run the Python debug for script.py

  2. The console is set to integratedTerminal as the debug console will otherwise swallow the output. On my own system the output first lists all of the my shell ENV variables, then again iterates them one at a time. It looks like it dies when it hits the LS_COLORS and is interpreting the internal = as a split between an environment variable key and value:

...
LC_CTYPE=en_CA.UTF-8
SETTING=1
WINDOWID=96468997
zsh: command not found: 34:ln=01
zsh: command not found: 36:mh=00:pi=40
zsh: command not found: 33:so=01
zsh: command not found: 35:do=01
zsh: command not found: 35:bd=40
zsh: command not found: 33
zsh: command not found: 01:cd=40
zsh: command not found: 33
zsh: command not found: 01:or=40
...

I have also tried with the shell set to /bin/bash with the same result.

Reproduces without extensions: Unable to check as the python extensions are required for the python debug.

Workaround: Removing the .envFile setting from the launch.json profile resolves the issue, or otherwise setting the values in the launch.json .env setting also avoids the problem - so it seems there is some difference in how the .envFile settings are being applied over the ones in .env.

Copied from original issue: microsoft/vscode#31065

Copied from original issue: DonJayamanne/pythonVSCode#1104

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions