microsoft / vscode-python

Python extension for Visual Studio Code
https://aka.ms/pvsc-marketplace
MIT License
4.32k stars 1.18k forks source link

python extension errors during a JSON parse #23108

Closed chnadell closed 4 months ago

chnadell commented 7 months ago

Type: Bug

Behaviour

Expected vs. Actual

Expected: Language server and linter can run when python extension is loaded

Actual: Python extension errors while trying to do a json parse, preventing language server and linter from running.

Steps to reproduce:

  1. Open vscode or reload window.

The odd character it's attempting to parse is rendered a little differently on github than it is on my machine: image

Diagnostic data

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

``` 2024-03-21 14:55:31.848 [info] Starting Jedi language server for trio-labs-control-server. 2024-03-21 14:55:34.131 [info] > python ~/.vscode/extensions/ms-python.python-2024.2.1/pythonFiles/printEnvVariables.py 2024-03-21 14:55:34.131 [info] shell: powershell 2024-03-21 14:55:35.785 [error] [ 'parseEnvironmentOutput, Class name = k, completed in 0ms, has a falsy return value', [SyntaxError: Unexpected token '', "[?25l"... is not valid JSON at JSON.parse () at c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:208425 at k.parseEnvironmentOutput (c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:397231) at c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:489940 at r.value (c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:490175) at c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:489940 at r.value (c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:490175) at k.getProcessEnvironmentVariables (c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:394173) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async I._applyCollectionImpl (c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:740505) at async I._applyCollection (c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:739462)] ] 2024-03-21 14:55:35.785 [error] [ 'Failed to parse Environment variables, Class name = k, completed in 2ms, has a falsy return value, Arg 1: "\\u001b[0m\\u001b[?25l\\r\\n YCYj \\r\\n cYXzu| d@C Jt \\r\\n |&/ zkv Q@n \\r\\n nXzJt a| @u (&q rznjjxCm \\r\\n Y 8C uLZz 0Q *@p( ww j \\r\\n h@vJqkmcX&Yc tz/ v0Yj pk /n \\r\\n %oOzr BZ j uXzXJX vwkwYr \\r\\n fb fd( |/rLWa 0Xx ukwu n cd \\r\\n jQQZbO qkJXYzx n0x n xXJ thqQLQX \\r\\n |XUr cBB n0W@@@%@8Qr akzxxrf( UXY \\r\\n |Z xzx/| n@%88@@@@@8W#oz fUCUcxff/( /O \\r\\n j UqX/ d@d | \\r\\n nhZ (r B xn fLwO \\r\\n mu CBdC(ra#pdw#p% c*wbC v&n td \\r\\n 0OJLqL h@@@@@8p U@8w mmLCLL \\r\\n v@@@@@af t \\r\\n |f 0bxm@@@*fff QW0 Y \\r\\n ( x8@O x#@@mjjj *@WXxn \\r\\n X&aka8p r0#8&a( |hwCYq8/ \\r\\n rk M| Xkf qJ /m \\r\\n jdx U@@k Q0 \\r\\n L@@@8 \\r\\n\\u001b[23A\\r\\n\\u001b[53G\\u001b[1;33m\\u001b[0m\\u001b[1;33mUSERNAME\\u001b[0m@\\u001b[1;33mTRIO-1012-PC\\u001b[0m\\r\\n\\u001b[53G\\u001b[1;33m\\u001b[0m----------------------------\\r\\n\\u001b[53G\\u001b[1;33mOS\\u001b[0m: Windows 11 Pro [64-bit]\\r\\n\\u001b[53G\\u001b[1;33mHost\\u001b[0m: LENOVO 20Y30088US\\r\\n\\u001b[53G\\u001b[1;33mKernel\\u001b[0m: 10.0.22621.0\\r\\n\\u001b[53G\\u001b[1;33mMotherboard\\u001b[0m: LENOVO 20Y30088US\\r\\n\\u001b[53G\\u001b[1;33mUptime\\u001b[0m: 8 days 14 hours 22 minutes\\r\\n\\u001b[53G\\u001b[1;33mShell\\u001b[0m: PowerShell v5.1.22621.2506\\r\\n\\u001b[53G\\u001b[1;33mResolution\\u001b[0m: 2560x1440, 1536x960\\r\\n\\u001b[53G\\u001b[1;33mTerminal\\u001b[0m: Visual Studio Code\\r\\n\\u001b[53G\\u001b[1;33mCPU\\u001b[0m: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.304GHz\\r\\n\\u001b[53G\\u001b[1;33mGPU\\u001b[0m: NVIDIA RTX A2000 Laptop GPU\\r\\n\\u001b[53G\\u001b[1;33mGPU\\u001b[0m: Intel(R) UHD Graphics\\r\\n\\u001b[53G\\u001b[1;33mMemory\\u001b[0m: 20.02 GiB / 31.73 GiB (63%)\\r\\n\\u001b[53G\\u001b[1;33mDisk (C:)\\u001b[0m: 501 GiB / 951 GiB (52%)\\r\\n\\u001b[53G\\u001b[1;33m\\u001b[0m\\r\\n\\u001b[53G\\u001b[1;33m\\u001b[0m\\u001b[0;40m \\u001b[0;41m \\u001b[0;42m \\u001b[0;43m \\u001b[0;44m \\u001b[0;45m \\u001b[0;46m \\u001b[0;47m \\u001b[0m\\r\\n\\u001b[53G\\u001b[1;33m\\u001b[0m\\u001b[0;100m \\u001b[0;101m \\u001b[0;102m \\u001b[0;103m \\u001b[0;104m \\u001b[0;105m \\u001b[0;106m \\u001b[0;107m \\u001b[0m\\r\\n\\u001b[4B\\r\\n\\u001b[?25h\\r\\n{\\"ALLUSERSPROFILE\\": \\"C:\\\\\\\\ProgramData\\", \\"APPDATA\\": \\"C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\AppData\\\\\\\\Roaming\\", \\"APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL\\": \\"1\\", \\"BASLER_FG_SDK_DIR\\": \\"C:\\\\\\\\Program Files\\\\\\\\Basler\\\\\\\\FramegrabberSDK\\", \\"CHOCOLATEYINSTALL\\": \\"C:\\\\\\\\ProgramData\\\\\\\\chocolatey\\", \\"CHOCOLATEYLASTPATHUPDATE\\": \\"133421143799540364\\", \\"CHOCOLATEYTOOLSLOCATION\\": \\"C:\\\\\\\\tools\\", \\"CHROME_CRASHPAD_PIPE_NAME\\": \\"\\\\\\\\\\\\\\\\.\\\\\\\\pipe\\\\\\\\crashpad_24964_UPHQRTFTZRGWLLKN\\", \\"CMAKE_PREFIX_PATH\\": \\"C:\\\\\\\\Program Files\\\\\\\\Basler\\\\\\\\pylon 7\\\\\\\\Development\\\\\\\\CMake\\\\\\\\pylon\\\\\\\\\\", \\"COMMONPROGRAMFILES\\": \\"C:\\\\\\\\Program Files\\\\\\\\Common Files\\", \\"COMMONPROGRAMFILES(X86)\\": \\"C:\\\\\\\\Program Files (x86)\\\\\\\\Common Files\\", \\"COMMONPROGRAMW6432\\": \\"C:\\\\\\\\Program Files\\\\\\\\Common Files\\", \\"COMPUTERNAME\\": \\"TRIO-1012-PC\\", \\"COMSPEC\\": \\"C:\\\\\\\\Windows\\\\\\\\system32\\\\\\\\cmd.exe\\", \\"CONDA_PROMPT_MODIFIER\\": \\"False\\", \\"DRIVERDATA\\": \\"C:\\\\\\\\Windows\\\\\\\\System32\\\\\\\\Drivers\\\\\\\\DriverData\\", \\"EFC_14728\\": \\"1\\", \\"ELECTRON_RUN_AS_NODE\\": \\"1\\", \\"FPS_BROWSER_APP_PROFILE_STRING\\": \\"Internet Explorer\\", \\"FPS_BROWSER_USER_PROFILE_STRING\\": \\"Default\\", \\"GENICAM_GENTL32_PATH\\": \\"C:\\\\\\\\Program Files\\\\\\\\Basler\\\\\\\\pylon 7\\\\\\\\Runtime\\\\\\\\Win32\\\\\\\\;C:\\\\\\\\Program Files\\\\\\\\Basler\\\\\\\\FramegrabberSDK\\\\\\\\Win32\\\\\\\\bin\\", \\"GENICAM_GENTL64_PATH\\": \\"C:\\\\\\\\Program Files\\\\\\\\Basler\\\\\\\\pylon 7\\\\\\\\Runtime\\\\\\\\x64\\\\\\\\;C:\\\\\\\\Program Files\\\\\\\\Basler\\\\\\\\FramegrabberSDK\\\\\\\\bin\\", \\"HOME\\": \\"C:\\\\\\\\Users\\\\\\\\USERNAME\\", \\"HOMEDRIVE\\": \\"C:\\", \\"HOMEPATH\\": \\"\\\\\\\\Users\\\\\\\\USERNAME\\", \\"LOCALAPPDATA\\": \\"C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\AppData\\\\\\\\Local\\", \\"LOGONSERVER\\": \\"\\\\\\\\\\\\\\\\TRIO-1012-PC\\", \\"NODE_UNC_HOST_ALLOWLIST\\": \\"trio-nas1\\", \\"NUMBER_OF_PROCESSORS\\": \\"16\\", \\"ONEDRIVE\\": \\"C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\OneDriveTrio\\\\\\\\OneDrive - Trio Labs\\", \\"ONEDRIVECOMMERCIAL\\": \\"C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\OneDriveTrio\\\\\\\\OneDrive - Trio Labs\\", \\"ORIGINAL_XDG_CURRENT_DESKTOP\\": \\"undefined\\", \\"OS\\": \\"Windows_NT\\", \\"PATH\\": \\"C:\\\\\\\\Program Files (x86)\\\\\\\\NVIDIA Corporation\\\\\\\\PhysX\\\\\\\\Common;C:\\\\\\\\Program Files\\\\\\\\Basler\\\\\\\\pylon 7\\\\\\\\Runtime\\\\\\\\x64\\\\\\\\;C:\\\\\\\\Program Files\\\\\\\\Basler\\\\\\\\pylon 7\\\\\\\\Runtime\\\\\\\\Win32\\\\\\\\;C:\\\\\\\\Windows\\\\\\\\system32;C:\\\\\\\\Windows;C:\\\\\\\\Windows\\\\\\\\System32\\\\\\\\Wbem;C:\\\\\\\\Windows\\\\\\\\System32\\\\\\\\WindowsPowerShell\\\\\\\\v1.0\\\\\\\\;C:\\\\\\\\Windows\\\\\\\\System32\\\\\\\\OpenSSH\\\\\\\\;C:\\\\\\\\Program Files\\\\\\\\Git\\\\\\\\cmd;C:\\\\\\\\ProgramData\\\\\\\\chocolatey\\\\\\\\bin;C:\\\\\\\\Program Files\\\\\\\\Memurai\\\\\\\\;C:\\\\\\\\Program Files\\\\\\\\Basler\\\\\\\\FramegrabberSDK\\\\\\\\bin;C:\\\\\\\\Program Files (x86)\\\\\\\\Microsoft SQL Server\\\\\\\\160\\\\\\\\DTS\\\\\\\\Binn\\\\\\\\;C:\\\\\\\\Program Files\\\\\\\\Azure Data Studio\\\\\\\\bin;C:\\\\\\\\Program Files (x86)\\\\\\\\Windows Kits\\\\\\\\8.1\\\\\\\\Windows Performance Toolkit\\\\\\\\;C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\AppData\\\\\\\\Local\\\\\\\\Programs\\\\\\\\Python\\\\\\\\Python311;;C:\\\\\\\\Program Files\\\\\\\\WindowsPowerShell\\\\\\\\Scripts;C:\\\\\\\\Program Files\\\\\\\\Docker\\\\\\\\Docker\\\\\\\\resources\\\\\\\\bin;C:\\\\\\\\Program Files\\\\\\\\dotnet\\\\\\\\;C:\\\\\\\\Program Files\\\\\\\\Tailscale\\\\\\\\;C:\\\\\\\\Program Files\\\\\\\\NVIDIA Corporation\\\\\\\\NVIDIA NvDLISR;C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\.cargo\\\\\\\\bin;C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\AppData\\\\\\\\Local\\\\\\\\Microsoft\\\\\\\\WindowsApps;C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\AppData\\\\\\\\Local\\\\\\\\Programs\\\\\\\\Microsoft VS Code\\\\\\\\bin;C:\\\\\\\\Program Files\\\\\\\\Azure Data Studio\\\\\\\\bin;C:\\\\\\\\Program Files (x86)\\\\\\\\Nmap;C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\AppData\\\\\\\\Local\\\\\\\\Programs\\\\\\\\oh-my-posh\\\\\\\\bin;C:\\\\\\\\tools\\\\\\\\winfetch;C:\\\\\\\\MinGW\\\\\\\\bin;C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\.dotnet\\\\\\\\tools;C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\AppData\\\\\\\\Local\\\\\\\\Microsoft\\\\\\\\WinGet\\\\\\\\Packages\\\\\\\\NSSM.NSSM_Microsoft.Winget.Source_8wekyb3d8bbwe\\\\\\\\nssm-2.24-101-g897c7ad\\\\\\\\win64;\\", \\"PATHEXT\\": \\".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL\\", \\"POSH_AZURE_ENABLED\\": \\"False\\", \\"POSH_GIT_ENABLED\\": \\"False\\", \\"POSH_INSTALLER\\": \\"winget\\", \\"POSH_PID\\": \\"13896\\", \\"POSH_SHELL_VERSION\\": \\"5.1.22621.2506\\", \\"POSH_THEME\\": \\"C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\AppData\\\\\\\\Local\\\\\\\\Programs\\\\\\\\oh-my-posh\\\\\\\\themes\\\\\\\\quick-term.omp.json\\", \\"POSH_THEMES_PATH\\": \\"C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\AppData\\\\\\\\Local\\\\\\\\Programs\\\\\\\\oh-my-posh\\\\\\\\themes\\", \\"POSTGRES_PW\\": \\"00000000\\", \\"POWERLINE_COMMAND\\": \\"oh-my-posh\\", \\"PROCESSOR_ARCHITECTURE\\": \\"AMD64\\", \\"PROCESSOR_IDENTIFIER\\": \\"Intel64 Family 6 Model 141 Stepping 1, GenuineIntel\\", \\"PROCESSOR_LEVEL\\": \\"6\\", \\"PROCESSOR_REVISION\\": \\"8d01\\", \\"PROGRAMDATA\\": \\"C:\\\\\\\\ProgramData\\", \\"PROGRAMFILES\\": \\"C:\\\\\\\\Program Files\\", \\"PROGRAMFILES(X86)\\": \\"C:\\\\\\\\Program Files (x86)\\", \\"PROGRAMW6432\\": \\"C:\\\\\\\\Program Files\\", \\"PSMODULEPATH\\": \\"C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\Documents\\\\\\\\WindowsPowerShell\\\\\\\\Modules;C:\\\\\\\\Program Files\\\\\\\\WindowsPowerShell\\\\\\\\Modules;C:\\\\\\\\Windows\\\\\\\\system32\\\\\\\\WindowsPowerShell\\\\\\\\v1.0\\\\\\\\Modules\\", \\"PUBLIC\\": \\"C:\\\\\\\\Users\\\\\\\\Public\\", \\"PYLON_DEV_DIR\\": \\"C:\\\\\\\\Program Files\\\\\\\\Basler\\\\\\\\pylon 7\\\\\\\\Development\\\\\\\\\\", \\"PYTHONIOENCODING\\": \\"utf-8\\", \\"PYTHONUNBUFFERED\\": \\"1\\", \\"SESSIONNAME\\": \\"Console\\", \\"SQLALCHEMY_DATABASE_URI\\": \\"postgresql+psycopg2://trio_labs_tracking:00000000@localhost/trio_labs_tracking_backup_081123\\", \\"SWDM_KEY\\": \\"TRIOLABSINC:swdocmgr_general-11785-02051-00064-50177-08660-34307-00007-25504-37739-43677-13560-38446-40258-46521-43013-63503-05421-22244-02949-24871-62472-22895-18768-15653-01329-19721-14629-00269-25144-23154-50910-23272-24676-26212-4,swdocmgr_previews-11785-02051-00064-50177-08660-34307-00007-13400-03853-37146-29341-47504-37640-36314-38914-35056-12677-62378-35382-43702-48178-24509-18768-15653-01329-19721-14629-00269-25144-23154-50910-23272-24676-26212-0,swdocmgr_dimxpert-11785-02051-00064-50177-08660-34307-00007-27592-28154-55416-28170-18843-46351-30332-57351-47483-19430-41025-11003-26870-09880-24516-18768-15653-01329-19721-14629-00269-25144-23154-50910-23272-24676-26212-3,swdocmgr_geometry-11785-02051-00064-50177-08660-34307-00007-04568-09535-10227-61734-05154-58514-02817-10241-24451-23933-62695-02786-24387-60202-22816-18768-15653-01329-19721-14629-00269-25144-23154-50910-23272-24676-26212-0,swdocmgr_xml-11785-02051-00064-50177-08660-34307-00007-02064-03790-41404-14070-39243-36997-15273-45056-24331-51231-49889-50714-31123-41294-24414-18768-15653-01329-19721-14629-00269-25144-23154-50910-23272-24676-26212-2,swdocmgr_tessellation-11785-02051-00064-50177-08660-34307-00007-20752-30074-24120-22335-48178-62841-29533-24576-60951-34307-18998-20136-55657-61425-22720-18768-15653-01329-19721-14629-00269-25144-23154-50910-23272-24676-26212-1\\", \\"SYSTEMDRIVE\\": \\"C:\\", \\"SYSTEMROOT\\": \\"C:\\\\\\\\Windows\\", \\"TEMP\\": \\"C:\\\\\\\\Users\\\\\\\\USER~1\\\\\\\\AppData\\\\\\\\Local\\\\\\\\Temp\\", \\"TMP\\": \\"C:\\\\\\\\Users\\\\\\\\USER~1\\\\\\\\AppData\\\\\\\\Local\\\\\\\\Temp\\", \\"USERDOMAIN\\": \\"AzureAD\\", \\"USERDOMAIN_ROAMINGPROFILE\\": \\"AzureAD\\", \\"USERNAME\\": \\"USERNAME\\", \\"USERPROFILE\\": \\"C:\\\\\\\\Users\\\\\\\\USERNAME\\", \\"VSCODE_AMD_ENTRYPOINT\\": \\"vs/workbench/api/node/extensionHostProcess\\", \\"VSCODE_CODE_CACHE_PATH\\": \\"C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\AppData\\\\\\\\Roaming\\\\\\\\Code\\\\\\\\CachedData\\\\\\\\863d2581ecda6849923a2118d93a088b0745d9d6\\", \\"VSCODE_CRASH_REPORTER_PROCESS_TYPE\\": \\"extensionHost\\", \\"VSCODE_CWD'... 501 more characters, [SyntaxError: Unexpected token '', "[?25l"... is not valid JSON at JSON.parse () at c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:208425 at k.parseEnvironmentOutput (c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:397231) at c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:489940 at r.value (c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:490175) at c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:489940 at r.value (c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:490175) at k.getProcessEnvironmentVariables (c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:394173) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async I._applyCollectionImpl (c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:740505) at async I._applyCollection (c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:739462)] ] ```

User Settings

``` 2024-03-21 14:55:31.848 [info] Starting Jedi language server for trio-labs-control-server. 2024-03-21 14:55:34.131 [info] > python ~/.vscode/extensions/ms-python.python-2024.2.1/pythonFiles/printEnvVariables.py 2024-03-21 14:55:34.131 [info] shell: powershell 2024-03-21 14:55:35.785 [error] [ 'parseEnvironmentOutput, Class name = k, completed in 0ms, has a falsy return value', [SyntaxError: Unexpected token '', "[?25l"... is not valid JSON at JSON.parse () at c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:208425 at k.parseEnvironmentOutput (c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:397231) at c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:489940 at r.value (c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:490175) at c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:489940 at r.value (c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:490175) at k.getProcessEnvironmentVariables (c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:394173) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async I._applyCollectionImpl (c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:740505) at async I._applyCollection (c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:739462)] ] 2024-03-21 14:55:35.785 [error] [ 'Failed to parse Environment variables, Class name = k, completed in 2ms, has a falsy return value, Arg 1: "\\u001b[0m\\u001b[?25l\\r\\n YCYj \\r\\n cYXzu| d@C Jt \\r\\n |&/ zkv Q@n \\r\\n nXzJt a| @u (&q rznjjxCm \\r\\n Y 8C uLZz 0Q *@p( ww j \\r\\n h@vJqkmcX&Yc tz/ v0Yj pk /n \\r\\n %oOzr BZ j uXzXJX vwkwYr \\r\\n fb fd( |/rLWa 0Xx ukwu n cd \\r\\n jQQZbO qkJXYzx n0x n xXJ thqQLQX \\r\\n |XUr cBB n0W@@@%@8Qr akzxxrf( UXY \\r\\n |Z xzx/| n@%88@@@@@8W#oz fUCUcxff/( /O \\r\\n j UqX/ d@d | \\r\\n nhZ (r B xn fLwO \\r\\n mu CBdC(ra#pdw#p% c*wbC v&n td \\r\\n 0OJLqL h@@@@@8p U@8w mmLCLL \\r\\n v@@@@@af t \\r\\n |f 0bxm@@@*fff QW0 Y \\r\\n ( x8@O x#@@mjjj *@WXxn \\r\\n X&aka8p r0#8&a( |hwCYq8/ \\r\\n rk M| Xkf qJ /m \\r\\n jdx U@@k Q0 \\r\\n L@@@8 \\r\\n\\u001b[23A\\r\\n\\u001b[53G\\u001b[1;33m\\u001b[0m\\u001b[1;33mUSERNAME\\u001b[0m@\\u001b[1;33mTRIO-1012-PC\\u001b[0m\\r\\n\\u001b[53G\\u001b[1;33m\\u001b[0m----------------------------\\r\\n\\u001b[53G\\u001b[1;33mOS\\u001b[0m: Windows 11 Pro [64-bit]\\r\\n\\u001b[53G\\u001b[1;33mHost\\u001b[0m: LENOVO 20Y30088US\\r\\n\\u001b[53G\\u001b[1;33mKernel\\u001b[0m: 10.0.22621.0\\r\\n\\u001b[53G\\u001b[1;33mMotherboard\\u001b[0m: LENOVO 20Y30088US\\r\\n\\u001b[53G\\u001b[1;33mUptime\\u001b[0m: 8 days 14 hours 22 minutes\\r\\n\\u001b[53G\\u001b[1;33mShell\\u001b[0m: PowerShell v5.1.22621.2506\\r\\n\\u001b[53G\\u001b[1;33mResolution\\u001b[0m: 2560x1440, 1536x960\\r\\n\\u001b[53G\\u001b[1;33mTerminal\\u001b[0m: Visual Studio Code\\r\\n\\u001b[53G\\u001b[1;33mCPU\\u001b[0m: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.304GHz\\r\\n\\u001b[53G\\u001b[1;33mGPU\\u001b[0m: NVIDIA RTX A2000 Laptop GPU\\r\\n\\u001b[53G\\u001b[1;33mGPU\\u001b[0m: Intel(R) UHD Graphics\\r\\n\\u001b[53G\\u001b[1;33mMemory\\u001b[0m: 20.02 GiB / 31.73 GiB (63%)\\r\\n\\u001b[53G\\u001b[1;33mDisk (C:)\\u001b[0m: 501 GiB / 951 GiB (52%)\\r\\n\\u001b[53G\\u001b[1;33m\\u001b[0m\\r\\n\\u001b[53G\\u001b[1;33m\\u001b[0m\\u001b[0;40m \\u001b[0;41m \\u001b[0;42m \\u001b[0;43m \\u001b[0;44m \\u001b[0;45m \\u001b[0;46m \\u001b[0;47m \\u001b[0m\\r\\n\\u001b[53G\\u001b[1;33m\\u001b[0m\\u001b[0;100m \\u001b[0;101m \\u001b[0;102m \\u001b[0;103m \\u001b[0;104m \\u001b[0;105m \\u001b[0;106m \\u001b[0;107m \\u001b[0m\\r\\n\\u001b[4B\\r\\n\\u001b[?25h\\r\\n{\\"ALLUSERSPROFILE\\": \\"C:\\\\\\\\ProgramData\\", \\"APPDATA\\": \\"C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\AppData\\\\\\\\Roaming\\", \\"APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL\\": \\"1\\", \\"BASLER_FG_SDK_DIR\\": \\"C:\\\\\\\\Program Files\\\\\\\\Basler\\\\\\\\FramegrabberSDK\\", \\"CHOCOLATEYINSTALL\\": \\"C:\\\\\\\\ProgramData\\\\\\\\chocolatey\\", \\"CHOCOLATEYLASTPATHUPDATE\\": \\"133421143799540364\\", \\"CHOCOLATEYTOOLSLOCATION\\": \\"C:\\\\\\\\tools\\", \\"CHROME_CRASHPAD_PIPE_NAME\\": \\"\\\\\\\\\\\\\\\\.\\\\\\\\pipe\\\\\\\\crashpad_24964_UPHQRTFTZRGWLLKN\\", \\"CMAKE_PREFIX_PATH\\": \\"C:\\\\\\\\Program Files\\\\\\\\Basler\\\\\\\\pylon 7\\\\\\\\Development\\\\\\\\CMake\\\\\\\\pylon\\\\\\\\\\", \\"COMMONPROGRAMFILES\\": \\"C:\\\\\\\\Program Files\\\\\\\\Common Files\\", \\"COMMONPROGRAMFILES(X86)\\": \\"C:\\\\\\\\Program Files (x86)\\\\\\\\Common Files\\", \\"COMMONPROGRAMW6432\\": \\"C:\\\\\\\\Program Files\\\\\\\\Common Files\\", \\"COMPUTERNAME\\": \\"TRIO-1012-PC\\", \\"COMSPEC\\": \\"C:\\\\\\\\Windows\\\\\\\\system32\\\\\\\\cmd.exe\\", \\"CONDA_PROMPT_MODIFIER\\": \\"False\\", \\"DRIVERDATA\\": \\"C:\\\\\\\\Windows\\\\\\\\System32\\\\\\\\Drivers\\\\\\\\DriverData\\", \\"EFC_14728\\": \\"1\\", \\"ELECTRON_RUN_AS_NODE\\": \\"1\\", \\"FPS_BROWSER_APP_PROFILE_STRING\\": \\"Internet Explorer\\", \\"FPS_BROWSER_USER_PROFILE_STRING\\": \\"Default\\", \\"GENICAM_GENTL32_PATH\\": \\"C:\\\\\\\\Program Files\\\\\\\\Basler\\\\\\\\pylon 7\\\\\\\\Runtime\\\\\\\\Win32\\\\\\\\;C:\\\\\\\\Program Files\\\\\\\\Basler\\\\\\\\FramegrabberSDK\\\\\\\\Win32\\\\\\\\bin\\", \\"GENICAM_GENTL64_PATH\\": \\"C:\\\\\\\\Program Files\\\\\\\\Basler\\\\\\\\pylon 7\\\\\\\\Runtime\\\\\\\\x64\\\\\\\\;C:\\\\\\\\Program Files\\\\\\\\Basler\\\\\\\\FramegrabberSDK\\\\\\\\bin\\", \\"HOME\\": \\"C:\\\\\\\\Users\\\\\\\\USERNAME\\", \\"HOMEDRIVE\\": \\"C:\\", \\"HOMEPATH\\": \\"\\\\\\\\Users\\\\\\\\USERNAME\\", \\"LOCALAPPDATA\\": \\"C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\AppData\\\\\\\\Local\\", \\"LOGONSERVER\\": \\"\\\\\\\\\\\\\\\\TRIO-1012-PC\\", \\"NODE_UNC_HOST_ALLOWLIST\\": \\"trio-nas1\\", \\"NUMBER_OF_PROCESSORS\\": \\"16\\", \\"ONEDRIVE\\": \\"C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\OneDriveTrio\\\\\\\\OneDrive - Trio Labs\\", \\"ONEDRIVECOMMERCIAL\\": \\"C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\OneDriveTrio\\\\\\\\OneDrive - Trio Labs\\", \\"ORIGINAL_XDG_CURRENT_DESKTOP\\": \\"undefined\\", \\"OS\\": \\"Windows_NT\\", \\"PATH\\": \\"C:\\\\\\\\Program Files (x86)\\\\\\\\NVIDIA Corporation\\\\\\\\PhysX\\\\\\\\Common;C:\\\\\\\\Program Files\\\\\\\\Basler\\\\\\\\pylon 7\\\\\\\\Runtime\\\\\\\\x64\\\\\\\\;C:\\\\\\\\Program Files\\\\\\\\Basler\\\\\\\\pylon 7\\\\\\\\Runtime\\\\\\\\Win32\\\\\\\\;C:\\\\\\\\Windows\\\\\\\\system32;C:\\\\\\\\Windows;C:\\\\\\\\Windows\\\\\\\\System32\\\\\\\\Wbem;C:\\\\\\\\Windows\\\\\\\\System32\\\\\\\\WindowsPowerShell\\\\\\\\v1.0\\\\\\\\;C:\\\\\\\\Windows\\\\\\\\System32\\\\\\\\OpenSSH\\\\\\\\;C:\\\\\\\\Program Files\\\\\\\\Git\\\\\\\\cmd;C:\\\\\\\\ProgramData\\\\\\\\chocolatey\\\\\\\\bin;C:\\\\\\\\Program Files\\\\\\\\Memurai\\\\\\\\;C:\\\\\\\\Program Files\\\\\\\\Basler\\\\\\\\FramegrabberSDK\\\\\\\\bin;C:\\\\\\\\Program Files (x86)\\\\\\\\Microsoft SQL Server\\\\\\\\160\\\\\\\\DTS\\\\\\\\Binn\\\\\\\\;C:\\\\\\\\Program Files\\\\\\\\Azure Data Studio\\\\\\\\bin;C:\\\\\\\\Program Files (x86)\\\\\\\\Windows Kits\\\\\\\\8.1\\\\\\\\Windows Performance Toolkit\\\\\\\\;C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\AppData\\\\\\\\Local\\\\\\\\Programs\\\\\\\\Python\\\\\\\\Python311;;C:\\\\\\\\Program Files\\\\\\\\WindowsPowerShell\\\\\\\\Scripts;C:\\\\\\\\Program Files\\\\\\\\Docker\\\\\\\\Docker\\\\\\\\resources\\\\\\\\bin;C:\\\\\\\\Program Files\\\\\\\\dotnet\\\\\\\\;C:\\\\\\\\Program Files\\\\\\\\Tailscale\\\\\\\\;C:\\\\\\\\Program Files\\\\\\\\NVIDIA Corporation\\\\\\\\NVIDIA NvDLISR;C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\.cargo\\\\\\\\bin;C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\AppData\\\\\\\\Local\\\\\\\\Microsoft\\\\\\\\WindowsApps;C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\AppData\\\\\\\\Local\\\\\\\\Programs\\\\\\\\Microsoft VS Code\\\\\\\\bin;C:\\\\\\\\Program Files\\\\\\\\Azure Data Studio\\\\\\\\bin;C:\\\\\\\\Program Files (x86)\\\\\\\\Nmap;C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\AppData\\\\\\\\Local\\\\\\\\Programs\\\\\\\\oh-my-posh\\\\\\\\bin;C:\\\\\\\\tools\\\\\\\\winfetch;C:\\\\\\\\MinGW\\\\\\\\bin;C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\.dotnet\\\\\\\\tools;C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\AppData\\\\\\\\Local\\\\\\\\Microsoft\\\\\\\\WinGet\\\\\\\\Packages\\\\\\\\NSSM.NSSM_Microsoft.Winget.Source_8wekyb3d8bbwe\\\\\\\\nssm-2.24-101-g897c7ad\\\\\\\\win64;\\", \\"PATHEXT\\": \\".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL\\", \\"POSH_AZURE_ENABLED\\": \\"False\\", \\"POSH_GIT_ENABLED\\": \\"False\\", \\"POSH_INSTALLER\\": \\"winget\\", \\"POSH_PID\\": \\"13896\\", \\"POSH_SHELL_VERSION\\": \\"5.1.22621.2506\\", \\"POSH_THEME\\": \\"C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\AppData\\\\\\\\Local\\\\\\\\Programs\\\\\\\\oh-my-posh\\\\\\\\themes\\\\\\\\quick-term.omp.json\\", \\"POSH_THEMES_PATH\\": \\"C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\AppData\\\\\\\\Local\\\\\\\\Programs\\\\\\\\oh-my-posh\\\\\\\\themes\\", \\"POSTGRES_PW\\": \\"00000000\\", \\"POWERLINE_COMMAND\\": \\"oh-my-posh\\", \\"PROCESSOR_ARCHITECTURE\\": \\"AMD64\\", \\"PROCESSOR_IDENTIFIER\\": \\"Intel64 Family 6 Model 141 Stepping 1, GenuineIntel\\", \\"PROCESSOR_LEVEL\\": \\"6\\", \\"PROCESSOR_REVISION\\": \\"8d01\\", \\"PROGRAMDATA\\": \\"C:\\\\\\\\ProgramData\\", \\"PROGRAMFILES\\": \\"C:\\\\\\\\Program Files\\", \\"PROGRAMFILES(X86)\\": \\"C:\\\\\\\\Program Files (x86)\\", \\"PROGRAMW6432\\": \\"C:\\\\\\\\Program Files\\", \\"PSMODULEPATH\\": \\"C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\Documents\\\\\\\\WindowsPowerShell\\\\\\\\Modules;C:\\\\\\\\Program Files\\\\\\\\WindowsPowerShell\\\\\\\\Modules;C:\\\\\\\\Windows\\\\\\\\system32\\\\\\\\WindowsPowerShell\\\\\\\\v1.0\\\\\\\\Modules\\", \\"PUBLIC\\": \\"C:\\\\\\\\Users\\\\\\\\Public\\", \\"PYLON_DEV_DIR\\": \\"C:\\\\\\\\Program Files\\\\\\\\Basler\\\\\\\\pylon 7\\\\\\\\Development\\\\\\\\\\", \\"PYTHONIOENCODING\\": \\"utf-8\\", \\"PYTHONUNBUFFERED\\": \\"1\\", \\"SESSIONNAME\\": \\"Console\\", \\"SQLALCHEMY_DATABASE_URI\\": \\"postgresql+psycopg2://trio_labs_tracking:00000000@localhost/trio_labs_tracking_backup_081123\\", \\"SWDM_KEY\\": \\"TRIOLABSINC:swdocmgr_general-11785-02051-00064-50177-08660-34307-00007-25504-37739-43677-13560-38446-40258-46521-43013-63503-05421-22244-02949-24871-62472-22895-18768-15653-01329-19721-14629-00269-25144-23154-50910-23272-24676-26212-4,swdocmgr_previews-11785-02051-00064-50177-08660-34307-00007-13400-03853-37146-29341-47504-37640-36314-38914-35056-12677-62378-35382-43702-48178-24509-18768-15653-01329-19721-14629-00269-25144-23154-50910-23272-24676-26212-0,swdocmgr_dimxpert-11785-02051-00064-50177-08660-34307-00007-27592-28154-55416-28170-18843-46351-30332-57351-47483-19430-41025-11003-26870-09880-24516-18768-15653-01329-19721-14629-00269-25144-23154-50910-23272-24676-26212-3,swdocmgr_geometry-11785-02051-00064-50177-08660-34307-00007-04568-09535-10227-61734-05154-58514-02817-10241-24451-23933-62695-02786-24387-60202-22816-18768-15653-01329-19721-14629-00269-25144-23154-50910-23272-24676-26212-0,swdocmgr_xml-11785-02051-00064-50177-08660-34307-00007-02064-03790-41404-14070-39243-36997-15273-45056-24331-51231-49889-50714-31123-41294-24414-18768-15653-01329-19721-14629-00269-25144-23154-50910-23272-24676-26212-2,swdocmgr_tessellation-11785-02051-00064-50177-08660-34307-00007-20752-30074-24120-22335-48178-62841-29533-24576-60951-34307-18998-20136-55657-61425-22720-18768-15653-01329-19721-14629-00269-25144-23154-50910-23272-24676-26212-1\\", \\"SYSTEMDRIVE\\": \\"C:\\", \\"SYSTEMROOT\\": \\"C:\\\\\\\\Windows\\", \\"TEMP\\": \\"C:\\\\\\\\Users\\\\\\\\USER~1\\\\\\\\AppData\\\\\\\\Local\\\\\\\\Temp\\", \\"TMP\\": \\"C:\\\\\\\\Users\\\\\\\\USER~1\\\\\\\\AppData\\\\\\\\Local\\\\\\\\Temp\\", \\"USERDOMAIN\\": \\"AzureAD\\", \\"USERDOMAIN_ROAMINGPROFILE\\": \\"AzureAD\\", \\"USERNAME\\": \\"USERNAME\\", \\"USERPROFILE\\": \\"C:\\\\\\\\Users\\\\\\\\USERNAME\\", \\"VSCODE_AMD_ENTRYPOINT\\": \\"vs/workbench/api/node/extensionHostProcess\\", \\"VSCODE_CODE_CACHE_PATH\\": \\"C:\\\\\\\\Users\\\\\\\\USERNAME\\\\\\\\AppData\\\\\\\\Roaming\\\\\\\\Code\\\\\\\\CachedData\\\\\\\\863d2581ecda6849923a2118d93a088b0745d9d6\\", \\"VSCODE_CRASH_REPORTER_PROCESS_TYPE\\": \\"extensionHost\\", \\"VSCODE_CWD'... 501 more characters, [SyntaxError: Unexpected token '', "[?25l"... is not valid JSON at JSON.parse () at c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:208425 at k.parseEnvironmentOutput (c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:397231) at c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:489940 at r.value (c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:490175) at c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:489940 at r.value (c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:490175) at k.getProcessEnvironmentVariables (c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:394173) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async I._applyCollectionImpl (c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:740505) at async I._applyCollection (c:\Users\USERNAME\.vscode\extensions\ms-python.python-2024.2.1\out\client\extension.js:2:739462)] ] ```

Extension version: 2024.2.1 VS Code version: Code 1.87.2 (863d2581ecda6849923a2118d93a088b0745d9d6, 2024-03-08T15:20:17.278Z) OS version: Windows_NT x64 10.0.22621 Modes: Connection to 'ssh-remote+172.16.12.174' could not be established

System Info |Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz (16 x 2304)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|31.73GB (13.09GB free)| |Process Argv|--crash-reporter-id 3c9369cf-602f-4847-9cb3-caebd5b7d5ea| |Screen Reader|no| |VM|0%| Connection to 'ssh-remote+172.16.12.174' could not be established
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805:30301674 binariesv615:30325510 vsaa593:30376534 py29gd2263:30899288 c4g48928:30535728 azure-dev_surveyone:30548225 a9j8j154:30646983 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 pythontbext0:30879054 accentitlementsc:30995553 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:30979542 d34g3935:30971562 fegfb526:30981948 bg6jg535:30979843 ccp1r3:30993539 dsvsc020:30976470 pythonait:30996668 gee8j676:30988843 ```
karthiknadig commented 7 months ago

@chnadell Can you run this code manually and share the output txt file?

> python %USERPROFILE%/.vscode/extensions/ms-python.python-2024.2.1/pythonFiles/printEnvVariables.py > python-output.txt
codekoriko commented 7 months ago

I have similar issue and python %USERPROFILE%/.vscode/extensions/ms-python.python-2024.2.1/pythonFiles/printEnvVariables.py > python-output.txt prints my environement variable just fine

It seems that vscode uses the default terminal profile to run printEnvVariables.py but this terminal loads Oh-my-posh profile that print out stuff upon initialisation and the output gets mashup with the output of printEnvVariables.py making it impossible to parse

If I set the default terminal to to use powershell 5 C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe

everything works fine,

would it be possible to use a different terminal profile for python initialization than the default terminal?

here is my log stripped Output > Python:

2024-03-31 15:28:15.684 [info] > D:/miniconda3/Scripts/activate ; conda activate clockify-me ; echo 'e8b39361-0157-4923-80e1-22d70d46dee6' ; python ~/.vscode/extensions/ms-python.python-2024.3.10871011/python_files/printEnvVariables.py
2024-03-31 15:28:15.684 [info] shell: powershellCore
2024-03-31 15:28:18.866 [warning] Got env variables but with errors Set-PSReadLineOption: The predictive suggestion feature cannot be enabled because the console output doesn't support virtual terminal processing or it's redirected.
Set-PSReadLineOption: D:\Documents\PowerShell\Microsoft.PowerShell_profile.ps1:43
Line |
  43 |  Set-PSReadLineOption -PredictionSource HistoryAndPlugin -PredictionVi .
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The predictive suggestion feature cannot be enabled because the console output doesn't support virtual terminal
     | processing or it's redirected.
 {
 ... [_JSON that contains my actual environnement variables_]...
}
2024-03-31 15:28:18.870 [info] > ~\AppData\Roaming\pypoetry\venv\Scripts\python.exe ~/.vscode/extensions/ms-python.python-2024.3.10871011/python_files/printEnvVariables.py
2024-03-31 15:28:18.870 [info] shell: powershellCore
2024-03-31 15:28:21.860 [error] [
  'parseEnvironmentOutput, Class name = k, completed in 0ms, has a falsy return value',
  SyntaxError: Unexpected token 'o', "oh-my-posh"... is not valid JSON
      at JSON.parse (<anonymous>)
      at c:\Users\myusername\.vscode\extensions\ms-python.python-2024.3.10871011\out\client\extension.js:2:203027
      at k.parseEnvironmentOutput (c:\Users\myusername\.vscode\extensions\ms-python.python-2024.3.10871011\out\client\extension.js:2:392560)
      at c:\Users\myusername\.vscode\extensions\ms-python.python-2024.3.10871011\out\client\extension.js:2:485679
      at k.r.value (c:\Users\myusername\.vscode\extensions\ms-python.python-2024.3.10871011\out\client\extension.js:2:485914)
      at c:\Users\myusername\.vscode\extensions\ms-python.python-2024.3.10871011\out\client\extension.js:2:485679
      at k.r.value (c:\Users\myusername\.vscode\extensions\ms-python.python-2024.3.10871011\out\client\extension.js:2:485914)
      at k.getProcessEnvironmentVariables (c:\Users\myusername\.vscode\extensions\ms-python.python-2024.3.10871011\out\client\extension.js:2:389502)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)
      at I._applyCollectionImpl (c:\Users\myusername\.vscode\extensions\ms-python.python-2024.3.10871011\out\client\extension.js:2:739880)
      at I._applyCollection (c:\Users\myusername\.vscode\extensions\ms-python.python-2024.3.10871011\out\client\extension.js:2:738837)
]
2024-03-31 15:28:21.860 [error] [
  'Failed to parse Environment variables, Class name = k, completed in 2ms, has a falsy return value, Arg 1: "oh-my-posh initialisation took 252.4723 ms\\r\\nCondaTabExpansion import 14.4207 ms\\r\\nposh-git import 251.4582 ms\\r\\nTerminal-Icons import 480.3578 ms\\r\\nPSReadLine import 1.2939 ms [_my actual environnement variables string_ ].
karthiknadig commented 7 months ago

Please share the python output, since this is really about parsing, it would be good to see the generated file. There might be some content that is left behind that it is failing to parse the JSON.

@anthonykim1 In the above stack is see Set-PSReadLineOption could this be from shell integration?

codekoriko commented 7 months ago

I explained in my original message, I already checked that the output of printEnvVariables.py, it's indeed returning a valid json containing my system's environment variables

anthonykim1 commented 7 months ago

@karthiknadig Can't guarantee if it is shell integration problem. The error is coming from https://github.com/microsoft/vscode-python/blob/main/src/client/interpreter/activation/service.ts#L333 rather than vscode-python/src/client/terminals/envCollectionActivation

I see Connection to 'ssh-remote+172.16.12.174' could not be established, but I believe shell integration may not be automatically enabled for remote scenario or subshells.

@codekoriko You should try guideline for manually installing shell integration via https://code.visualstudio.com/docs/terminal/shell-integration#_manual-installation

Enabling shell integration via manual injection this way may resolve your problem.

karthiknadig commented 7 months ago

@codekoriko Can you share your custom profile configuration?

github-actions[bot] commented 4 months ago

Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.

Happy Coding!