Python Extension API incorrectly triggers 'remove' event
See original GitHub issueOn CI we’re using a Python global Python env, In the middle of the tests, the Python extension API triggers and event indicating the python environment has been deleted and this then causes a few other issues in Jupyter extension
Note: We do not delete the global python env hence I do not expect to receive such and event. If we’re using the event incorrectly please do let us know.
Here are the interesting logs
- Jupyter Logs
2022-11-30T00:05:36.8558283Z verbose 00:05:36.535: Interpreter removed /opt/hostedtoolcache/Python/3.10.8/x64/bin/python
2022-11-30T00:05:36.8560009Z verbose 00:05:36.535: Interpreter /opt/hostedtoolcache/Python/3.10.8/x64/bin/python deleted, hence deleting corresponding kernel startUsingPythonInterpreter:'.jvsc74a57bd079f32d02658bf12f8569a265222c57f47d77ad75a8d38a3c9f42a05c99ab6a7e./opt/hostedtoolcache/Python/3.10.8/x64/python./opt/hostedtoolcache/Python/3.10.8/x64/python.-m#ipykernel_launcher
2022-11-30T00:05:36.8562018Z verbose 00:05:36.535: Local Python connection deleted startUsingPythonInterpreter:'.jvsc74a57bd079f32d02658bf12f8569a265222c57f47d77ad75a8d38a3c9f42a05c99ab6a7e./opt/hostedtoolcache/Python/3.10.8/x64/python./opt/hostedtoolcache/Python/3.10.8/x64/python.-m#ipykernel_launcher: (interpreter id=/opt/hostedtoolcache/Python/3.10.8/x64/bin/python)'
2022-11-30T00:05:36.8568304Z verbose 00:05:36.536: Updating cache with Local kernels startUsingLocalKernelSpec:'..net-csharp./dotnet./.dotnet#interactive#jupyter#--default-kernel#csharp#{connection_file}#--http-port-range#2048-3000 (interpreter id = undefined)', startUsingLocalKernelSpec:'..net-fsharp./dotnet./.dotnet#interactive#jupyter#--default-kernel#fsharp#{connection_file}#--http-port-range#2048-3000 (interpreter id = undefined)', startUsingLocalKernelSpec:'..net-powershell./dotnet./.dotnet#interactive#jupyter#--default-kernel#powershell#{connection_file}#--http-port-range#2048-3000 (interpreter id = undefined)', startUsingLocalKernelSpec:'.julia-1.5./opt/hostedtoolcache/julia/1.5.2/x64/bin/julia././opt/hostedtoolcache/julia/1.5.2/x64/bin/julia#-i#--color=yes#--project=@.#/home/runner/.julia/packages/ijulia/aqu2h/src/kernel.jl#{connection_file} (interpreter id = undefined)', startUsingLocalKernelSpec:'..venvkernel./home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvkernel/python./home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvkernel/python.-m#ipykernel_launcher (interpreter id = /home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvkernel/bin/python)', startUsingLocalKernelSpec:'..venvnokernel./home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvnokernel/python./home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvnokernel/python.-m#ipykernel_launcher (interpreter id = /home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvnokernel/bin/python)'
& here are the logs from Python extension at the same time
[INFO 2022-10-30 0:5:35.965]: Found interpreter for >> /opt/hostedtoolcache/Python/3.10.8/x64/python /tmp/vscode_jupyter_exts/ms-python.python-2022.19.13321005/pythonFiles/get_output_via_markers.py /tmp/vscode_jupyter_exts/ms-python.python-2022.19.13321005/pythonFiles/interpreterInfo.py <<: {"versionInfo":[3,10,8,"final",0],"sysPrefix":"/opt/hostedtoolcache/Python/3.10.8/x64/.","sysVersion":"3.10.8 (main, Oct 18 2022, 06:43:21) [GCC 9.4.0]","is64Bit":true}
[DEBUG 2022-10-30 0:5:35.968]: No cached env found for /opt/hostedtoolcache/Python/3.10.8/x64/bin/python
[INFO 2022-10-30 0:5:35.970]: Environments added to cache [{"name":"base","location":"/usr/share/miniconda","kind":"virt-conda","executable":{"filename":"/usr/share/miniconda/bin/python","sysPrefix":"/usr/share/miniconda","ctime":1668862752754,"mtime":1668862752754},"display":"Python 3.9.12 ('base')","version":{"major":3,"minor":9,"micro":12,"release":{"level":"final","serial":0},"sysVersion":"3.9.12 (main, Apr 5 2022, 06:56:58) \n[GCC 7.5.0]"},"arch":3,"distro":{"org":"Anaconda, Inc."},"source":[],"type":"Conda","id":"/usr/share/miniconda/bin/python","detailedDisplayName":"Python 3.9.12 ('base': conda)"},{"name":".venvkernel","location":"/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvkernel","kind":"virt-venv","executable":{"filename":"/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvkernel/bin/python","sysPrefix":"/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvkernel","ctime":1669766644084,"mtime":1669766644084},"searchLocation":{"$mid":1,"fsPath":"/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvkernel","path":"/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvkernel","scheme":"file"},"display":"Python 3.10.8 ('.venvkernel': venv)","version":{"major":3,"minor":10,"micro":8,"release":{"level":"final","serial":0},"sysVersion":"3.10.8 (main, Oct 18 2022, 06:43:21) [GCC 9.4.0]"},"arch":3,"distro":{"org":""},"source":[],"type":"Virtual","id":"/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvkernel/bin/python","detailedDisplayName":"Python 3.10.8 ('.venvkernel': venv)"},{"name":".venvnokernel","location":"/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvnokernel","kind":"virt-venv","executable":{"filename":"/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvnokernel/bin/python","sysPrefix":"/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvnokernel","ctime":1669766672094,"mtime":1669766672094},"searchLocation":{"$mid":1,"fsPath":"/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvnokernel","path":"/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvnokernel","scheme":"file"},"display":"Python 3.10.8 ('.venvnokernel': venv)","version":{"major":3,"minor":10,"micro":8,"release":{"level":"final","serial":0},"sysVersion":"3.10.8 (main, Oct 18 2022, 06:43:21) [GCC 9.4.0]"},"arch":3,"distro":{"org":""},"source":[],"type":"Virtual","id":"/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvnokernel/bin/python","detailedDisplayName":"Python 3.10.8 ('.venvnokernel': venv)"},{"name":".venvnoreg","location":"/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvnoreg","kind":"virt-venv","executable":{"filename":"/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvnoreg/bin/python","sysPrefix":"/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvnoreg","ctime":1669766640228,"mtime":1669766640228},"searchLocation":{"$mid":1,"fsPath":"/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvnoreg","path":"/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvnoreg","scheme":"file"},"display":"Python 3.10.8 ('.venvnoreg': venv)","version":{"major":3,"minor":10,"micro":8,"release":{"level":"final","serial":0},"sysVersion":"3.10.8 (main, Oct 18 2022, 06:43:21) [GCC 9.4.0]"},"arch":3,"distro":{"org":""},"source":[],"type":"Virtual","id":"/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvnoreg/bin/python","detailedDisplayName":"Python 3.10.8 ('.venvnoreg': venv)"},{"name":"","location":"","kind":"global-other","executable":{"filename":"/bin/python","sysPrefix":"/usr","ctime":1668861006324,"mtime":1586947544000},"display":"Python 3.8.10 64-bit","version":{"major":3,"minor":8,"micro":10,"release":{"level":"final","serial":0},"sysVersion":"3.8.10 (default, Jun 22 2022, 20:18:18) \n[GCC 9.4.0]"},"arch":3,"distro":{"org":""},"source":["path env var"],"id":"/bin/python","detailedDisplayName":"Python 3.8.10 64-bit"},{"name":"","location":"","kind":"global-other","executable":{"filename":"/bin/python2","sysPrefix":"/usr","ctime":1668860991299,"mtime":1584102683000},"display":"Python 2.7.18 64-bit","version":{"major":2,"minor":7,"micro":18,"release":{"level":"final","serial":0},"sysVersion":"2.7.18 (default, Jul 1 2022, 12:27:04) \n[GCC 9.4.0]"},"arch":3,"distro":{"org":""},"source":["path env var"],"id":"/bin/python2","detailedDisplayName":"Python 2.7.18 64-bit"},{"name":"","location":"","kind":"global-other","executable":{"filename":"/usr/bin/python","sysPrefix":"/usr","ctime":1668861006324,"mtime":1586947544000},"display":"Python 3.8.10 64-bit","version":{"major":3,"minor":8,"micro":10,"release":{"level":"final","serial":0},"sysVersion":"3.8.10 (default, Jun 22 2022, 20:18:18) \n[GCC 9.4.0]"},"arch":3,"distro":{"org":""},"source":["path env var"],"id":"/usr/bin/python","detailedDisplayName":"Python 3.8.10 64-bit"},{"name":"","location":"","kind":"global-other","executable":{"filename":"/opt/hostedtoolcache/Python/3.10.8/x64/python","sysPrefix":"/opt/hostedtoolcache/Python/3.10.8/x64/.","ctime":1669766020363,"mtime":1668865149931},"display":"Python 3.10.8 64-bit","version":{"major":3,"minor":10,"micro":8,"release":{"level":"final","serial":0},"sysVersion":"3.10.8 (main, Oct 18 2022, 06:43:21) [GCC 9.4.0]"},"arch":3,"distro":{"org":""},"source":["path env var"],"id":"/opt/hostedtoolcache/Python/3.10.8/x64/python","detailedDisplayName":"Python 3.10.8 64-bit"}]
[INFO 2022-10-30 0:5:35.971]: [
'Display locator refreshing progress, Class name = f, completed in 0ms, has a falsy return value, , Return Value: undefined'
]
[INFO 2022-10-30 0:5:35.973]: [
'Hide locator refreshing progress, Class name = f, completed in 0ms, has a falsy return value, , Return Value: undefined'
]
[DEBUG 2022-10-30 0:5:35.975]: Cached data exists KeyPrefix=Cache_Method_Output_m.addKeyToStorage-Args="workspace"-Arg-Separator-"autoSelectedWorkspacePythonInterpreter-/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience"-Arg-Separator-undefined
[DEBUG 2022-10-30 0:5:35.976]: Cached data exists KeyPrefix=Cache_Method_Output_m.addKeyToStorage-Args="global"-Arg-Separator-"WORKSPACE_FOLDER_INTERPRETER_PATH_/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience"-Arg-Separator-undefined
[DEBUG 2022-10-30 0:5:35.976]: Cached data exists KeyPrefix=Cache_Method_Output_m.addKeyToStorage-Args="global"-Arg-Separator-"WORKSPACE_FOLDER_INTERPRETER_PATH_/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience"-Arg-Separator-undefined
[DEBUG 2022-10-30 0:5:35.978]: Cached data exists KeyPrefix=Cache_Method_Output_m.addKeyToStorage-Args="global"-Arg-Separator-"WORKSPACE_FOLDER_INTERPRETER_PATH_/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience"-Arg-Separator-undefined
[DEBUG 2022-10-30 0:5:35.978]: Cached data exists KeyPrefix=Cache_Method_Output_m.addKeyToStorage-Args="global"-Arg-Separator-"WORKSPACE_FOLDER_INTERPRETER_PATH_/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience"-Arg-Separator-undefined
[DEBUG 2022-10-30 0:5:35.996]: Cached data exists KeyPrefix=Cache_Method_Output_m.addKeyToStorage-Args="global"-Arg-Separator-"WORKSPACE_FOLDER_INTERPRETER_PATH_/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience"-Arg-Separator-undefined
[DEBUG 2022-10-30 0:5:35.996]: Cached data exists KeyPrefix=Cache_Method_Output_m.addKeyToStorage-Args="global"-Arg-Separator-"WORKSPACE_FOLDER_INTERPRETER_PATH_/home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience"-Arg-Separator-undefined
[DEBUG 2022-10-30 0:5:36.7]: Searching for conda environments using conda
[DEBUG 2022-10-30 0:5:36.7]: Cached data exists KeyPrefix=Cache_Method_Output_y.getEnvList-Args=
[DEBUG 2022-10-30 0:5:36.18]: Looking into conda env for executable: {"prefix":"/usr/share/miniconda","name":"base"}
[DEBUG 2022-10-30 0:5:36.34]: Searching for workspace virtual envs in: /home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience
[DEBUG 2022-10-30 0:5:36.35]: Found executable within conda env {"prefix":"/usr/share/miniconda","name":"base"}
[DEBUG 2022-10-30 0:5:36.35]: Found conda executable: /usr/share/miniconda/bin/python
[DEBUG 2022-10-30 0:5:36.59]: Workspace Virtual Environment: [added] /home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvkernel/bin/python
[DEBUG 2022-10-30 0:5:36.59]: Workspace Virtual Environment: [skipped] /home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvkernel/bin/python3
[DEBUG 2022-10-30 0:5:36.59]: Workspace Virtual Environment: [skipped] /home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvkernel/bin/python3.10
[DEBUG 2022-10-30 0:5:36.59]: No cached env found for /opt/hostedtoolcache/Python/3.10.8/x64/bin/python
[DEBUG 2022-10-30 0:5:36.59]: No cached env found for /opt/hostedtoolcache/Python/3.10.8/x64/bin/python
[DEBUG 2022-10-30 0:5:36.59]: No cached env found for /opt/hostedtoolcache/Python/3.10.8/x64/bin/python
[DEBUG 2022-10-30 0:5:36.59]: No cached env found for /opt/hostedtoolcache/Python/3.10.8/x64/bin/python
[DEBUG 2022-10-30 0:5:36.59]: No cached env found for /opt/hostedtoolcache/Python/3.10.8/x64/bin/python
[INFO 2022-10-30 0:5:36.60]: Found: /bin/python --> /bin/python3.8
[INFO 2022-10-30 0:5:36.60]: Found: /bin/python2 --> /bin/python2.7
[INFO 2022-10-30 0:5:36.61]: Found: /bin/python2.7 --> /bin/python2.7
[INFO 2022-10-30 0:5:36.71]: Found: /bin/python3 --> /bin/python3.8
[DEBUG 2022-10-30 0:5:36.71]: Workspace Virtual Environment: [added] /home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvnokernel/bin/python
[DEBUG 2022-10-30 0:5:36.71]: Workspace Virtual Environment: [skipped] /home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvnokernel/bin/python3
[DEBUG 2022-10-30 0:5:36.71]: Workspace Virtual Environment: [skipped] /home/runner/work/vscode-jupyter/vscode-jupyter/src/test/datascience/.venvnokernel/bin/python3.10
[INFO 2022-10-30 0:5:36.76]: Found: /bin/python3.8 --> /bin/python3.8
Issue Analytics
- State:
- Created 10 months ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Trigger Tkinter events from a different class in Python
My current problem is with trying to trigger an event from a different class. A simple version of the problem is this:
Read more >VS Code API | Visual Studio Code Extension API
Event triggered by extensions to signal to the editor that an edit has occurred on an CustomDocument. see - onDidChangeCustomDocument. Properties. document: T....
Read more >Initialization, Finalization, and Threads — Python 3.11.1 ...
Undo all initializations made by Py_Initialize() and subsequent use of Python/C API functions, and destroy all sub-interpreters (see Py_NewInterpreter() below) ...
Read more >EventTarget.removeEventListener() - Web APIs | MDN
The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.
Read more >Lambda Extensions API - AWS Documentation
Shutdown : This phase is triggered if the Lambda function does not receive any invocations for a period of time. In the Shutdown...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

And I also kicked it off, so you’re doubly covered. 😉
Before the New Year, there’s unfortunately no chance as there’s no one around to handle any issues that may come up. But we can definitely consider doing a bugfix release the week of Jan 3 if you can confirm that the fix does what you need.
I’m OOF starting now until 3rd, Brett can help with the timelines. I’ve mentioned a workaround here in case the timeline doesn’t work for you guys: https://github.com/microsoft/vscode-python/issues/20292#issuecomment-1362817133
Done, should be out soon.