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

Cannot unset environment variables in launch configuration #396

Closed
brechtm opened this issue Aug 31, 2020 · 4 comments
Closed

Cannot unset environment variables in launch configuration #396

brechtm opened this issue Aug 31, 2020 · 4 comments

Comments

@brechtm
Copy link

brechtm commented Aug 31, 2020

The Launch.json attributes section of the VSCode documentation mentions that the env atttribute of a launch configuration supports unsetting variables by using the null value.

This doesn't seem to work for Python launch configurations:

  • it doesn't undefine variables when running a program
  • an error dialog is shown when debugging a program (or test in my case):

    Invalid message: "env"["ELECTRON_RUN_AS_NODE"] must be str

Environment data

  • VS Code version: 1.48.2
  • Extension version (available under the Extensions sidebar): 2020.8.105045
  • OS and version: macOS High Sierra 10.13.6
  • Python version (& distribution if applicable, e.g. Anaconda): CPython 3.8.3
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Value of the python.languageServer setting: (User) Microsoft
@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python Aug 31, 2020
@int19h
Copy link
Contributor

int19h commented Aug 31, 2020

Yep, it's not supported at the moment. #93 is tracking this.

@int19h int19h closed this as completed Aug 31, 2020
@brechtm
Copy link
Author

brechtm commented Aug 31, 2020

Note that this doesn't work when running (versus debugging) either. I don't know if that is also handled by debugpy or not.

@int19h
Copy link
Contributor

int19h commented Aug 31, 2020

It does - running without debugging is debugpy running with "noDebug": true, and environment handling is the same in that case.

@brechtm
Copy link
Author

brechtm commented Sep 4, 2020

Thanks for the clarification. I asked because I don't get the Invalid message: "env"["ELECTRON_RUN_AS_NODE"] must be str error when running (no debug).

I had a go at implementing this, but I didn't get far, unfortunately...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants