Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python / envFile in launch.json causes issues #149

Closed
DonJayamanne opened this issue Nov 14, 2017 · 1 comment
Closed

Python / envFile in launch.json causes issues #149

DonJayamanne opened this issue Nov 14, 2017 · 1 comment
Labels
bug Issue identified by VS Code Team member as probable bug
Milestone

Comments

@DonJayamanne
Copy link

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

@DonJayamanne
Copy link
Author

From @weinand on July 19, 2017 18:50

The Python debugger is not part of VS Code. I'll move the issue.

@brettcannon brettcannon added awaiting 1-verification bug Issue identified by VS Code Team member as probable bug labels Nov 14, 2017
@DonJayamanne DonJayamanne added this to the December 2017 milestone Nov 17, 2017
DonJayamanne added a commit that referenced this issue Nov 22, 2017
#249)

- Fixes #25, #32, #35, #235, #242 (unable to run without debugging using CTRL+F5)   
- Fixes #191, #158, #24, #136  (error message displayed when debugged code terminates)  
- Fixes #157 (debugger crashes when python program does not launch)
- Fixes #114, #149, #250 (use vscode infrastructure to launch debugger in integrated and external terminals)  
- Fixes #239 Remove prompt added to pause terminal upon program completion
@lock lock bot locked as resolved and limited conversation to collaborators Jul 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

2 participants