Closed d3r3kk closed 5 years ago
Still happening in version 2019.9.34911 of the extension
Has anyone else (user) reported this issue?
Doesn't seem like it.
If that's the case, I'd prefer we close this. No point leaving it open if we aren't going to fix until someone reports this.
Environment data
Actual behavior
Environment variable set into my
.env
file is not available in the environment of my runtime.Expected behavior
Environment variables set into my
.env
file are available.Steps to reproduce:
.env
file in VSCode, and notice that the encoding is UTF-16 LE.print(os.environ['COMPUTERNAME'] print(os.environ['MYVAR']
##########Linting Output - pylint########## No config file found, using default configuration
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
/C:/Program Files/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:2912 Loading development extension at D:\dev\github\vscode\vscode-python /C:/Program Files/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:2813 [Extension Host] STOPPED on first line for debugging on port 44832 (anonymous) @ /C:/Program Files/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:2813 /C:/Program Files/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:2811 [Extension Host] debugger inspector at %cDebugger listening on port 44832. Warning: This is an experimental feature and could change at any ti%cme. To start debugging, open the following URL in Chrome: chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=127.0.0.1:44832/768bc727-2970-40bd-8607-4d8c20d45fac
/C:/Program Files/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:2811 [Extension Host] debugger inspector at %cDebugger attached.
PS D:\dev\vsts\dekeeler\Python\test4pipenv> cd 'd:\dev\vsts\dekeeler\Python\test4pipenv'; ${env:pythonioencoding}='UTF-8'; ${env:pythonunbuffered}='1'; & 'C:\Users\dekeeler.virtualenvs\test4pipenv-9X8xIwhZ\scripts\python.exe' 'D:\dev\github\vscode\vscode-python\pythonFiles\PythonTools\visualstudio_py_launcher.py' 'd:\dev\vsts\dekeeler\Python\test4pipenv' '14824' '34806ad9-833a-4524-8cd6-18ca4aa74f14' 'RedirectOutput,RedirectOutput' 'd:\dev\vsts\dekeeler\Python\test4pipenv\test.py' DEK-DESKTOP01 Traceback (most recent call last): File "d:\dev\vsts\dekeeler\Python\test4pipenv\test.py", line 4, in
print(os.environ['MYVAR'])
File "C:\Users\dekeeler.virtualenvs\test4pipenv-9X8xIwhZ\lib\os.py", line 669, in getitem
raise KeyError(key) from None
KeyError: 'MYVAR'
PS D:\dev\vsts\dekeeler\Python\test4pipenv>