Description
Exactly the same issue (but on latest VSCode + python debugger) as reported on microsoft/vscode-python#21561 by @thealphamoose.
C/P here for completeness:
Debug does not stop executing when I tried to stop debugging after hitting a breakpoint. I found this problem reported Aug 18,2020 and the solution from Microsoft was to install the most recent release. But I have the most recent 1.79.2. Visual Studio Code
My app is written in python/Django. It used to work three months ago but since I have returned to the app for some changes my VSC must have updated to 1.79.2 and now this issue has appeared.
Details: When I set a breakpoint and it is tripped, the code execution stops normally. I can step, I can continue, all is good. But when I STOP (the red button on the ribbon) the program continues executing. If I hit stop a second time the program does stop but a great deal of code has been executed between the first and second clicks.
Diagnostic data
launch.json
configuration
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Django",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/manage.py",
"args": [
"runserver",
"--noreload",
"0.0.0.0:8000"
],
"django": true,
"justMyCode": false
}
]
}
Output for Python
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
2025-01-29 21:59:11.250 [info] Experiment 'pythonRecommendTensorboardExt' is active
2025-01-29 21:59:11.250 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2025-01-29 21:59:11.250 [info] Experiment 'pythonTestAdapter' is active
2025-01-29 21:59:11.250 [info] Native locator: Refresh started
2025-01-29 21:59:11.250 [info] Native locator: Refresh started
2025-01-29 21:59:11.274 [info] > pyenv which python
2025-01-29 21:59:11.274 [info] cwd: .
2025-01-29 21:59:11.278 [info] Python interpreter path: ~/mc/.venv/bin/python
2025-01-29 21:59:11.515 [info] Shell integration status changed, can confirm it's working.
2025-01-29 21:59:11.681 [info] > . ~/mc/.venv/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode-server/extensions/ms-python.python-2024.22.2-linux-x64/python_files/printEnvVariables.py
2025-01-29 21:59:11.681 [info] shell: bash
2025-01-29 21:59:11.683 [info] > . ~/mc/.venv/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode-server/extensions/ms-python.python-2024.22.2-linux-x64/python_files/printEnvVariables.py
2025-01-29 21:59:11.683 [info] shell: bash
2025-01-29 21:59:11.714 [info] > /usr/bin/python ~/.vscode-server/extensions/ms-python.python-2024.22.2-linux-x64/python_files/printEnvVariables.py
2025-01-29 21:59:11.715 [info] shell: bash
2025-01-29 21:59:11.717 [info] > /usr/bin/python ~/.vscode-server/extensions/ms-python.python-2024.22.2-linux-x64/python_files/printEnvVariables.py
2025-01-29 21:59:11.717 [info] shell: bash
2025-01-29 21:59:11.753 [info] Setting environment variable VIRTUAL_ENV in collection to /home/a/mc/.venv {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-01-29 21:59:11.753 [info] Prepending environment variable PS1 in collection with (.venv) {"applyAtShellIntegration":true,"applyAtProcessCreation":false}
2025-01-29 21:59:11.753 [info] Prepending environment variable PATH in collection with /home/a/.vscode-server/extensions/ms-python.python-2024.22.2-linux-x64/python_files/deactivate/bash:/home/a/mc/.venv/bin: {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-01-29 21:59:11.754 [info] Send text to terminal: /usr/bin/python /home/a/.vscode-server/extensions/ms-python.python-2024.22.2-linux-x64/python_files/printEnvVariablesToFile.py /home/a/.vscode-server/extensions/ms-python.python-2024.22.2-linux-x64/python_files/deactivate/bash/envVars.txt
2025-01-29 21:59:11.754 [info] Setting environment variable VIRTUAL_ENV in collection to /home/a/mc/.venv {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-01-29 21:59:11.755 [info] Prepending environment variable PS1 in collection with (.venv) {"applyAtShellIntegration":true,"applyAtProcessCreation":false}
2025-01-29 21:59:11.755 [info] Prepending environment variable PATH in collection with /home/a/.vscode-server/extensions/ms-python.python-2024.22.2-linux-x64/python_files/deactivate/bash:/home/a/mc/.venv/bin: {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2025-01-29 21:59:12.281 [info] Starting Pylance language server.
2025-01-29 21:59:14.191 [info] Native locator: Refresh finished in 3420 ms
2025-01-29 21:59:41.754 [error] Failed to initialize deactivate script /bin/bash [Error: "/home/a/.vscode-server/extensions/ms-python.python-2024.22.2-linux-x64/python_files/deactivate/bash/envVars.txt" file not created
at Timeout.<anonymous> (/home/a/.vscode-server/extensions/ms-python.python-2024.22.2-linux-x64/out/client/extension.js:2:313536)
at listOnTimeout (node:internal/timers:581:17)
at process.processTimers (node:internal/timers:519:7)]
2025-01-29 21:59:41.754 [error] Failed to initialize deactivate script /bin/bash [Error: "/home/a/.vscode-server/extensions/ms-python.python-2024.22.2-linux-x64/python_files/deactivate/bash/envVars.txt" file not created
at Timeout.<anonymous> (/home/a/.vscode-server/extensions/ms-python.python-2024.22.2-linux-x64/out/client/extension.js:2:313536)
at listOnTimeout (node:internal/timers:581:17)
at process.processTimers (node:internal/timers:519:7)]
2025-01-30 17:53:08.544 [info] Discover tests for workspace name: backend - uri: /home/a/xyz/backend/xyz.py
2025-02-02 16:07:35.429 [info] Discover tests for workspace name: backend - uri: /home/a/xyz/backend/xyz.py
2025-02-02 16:07:50.389 [info] Send text to terminal: /usr/bin/env /home/a/mc/.venv/bin/python /home/a/.vscode-server/extensions/ms-python.debugpy-2024.14.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher 48257 -- /home/a/xyz/backend/manage.py runserver
2025-02-02 16:11:04.846 [info] Send text to terminal: �
2025-02-02 16:11:05.046 [info] Send text to terminal: cd /home/a/xyz/backend ; /usr/bin/env /home/a/mc/.venv/bin/python /home/a/.vscode-server/extensions/ms-python.debugpy-2024.14.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher 54817 -- /home/a/xyz/backend/manage.py runserver
2025-02-02 16:11:37.047 [info] Send text to terminal: /usr/bin/env /home/a/mc/.venv/bin/python /home/a/.vscode-server/extensions/ms-python.debugpy-2024.14.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher 53639 -- /home/a/xyz/backend/manage.py runserver
2025-02-02 16:12:23.287 [info] Send text to terminal: /usr/bin/env /home/a/mc/.venv/bin/python /home/a/.vscode-server/extensions/ms-python.debugpy-2024.14.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher 35381 -- /home/a/xyz/backend/manage.py runserver
Output for Python Debugger
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python Debugger
)
2025-02-02 16:07:49.303 [info] Resolving launch configuration with substituted variables
2025-02-02 16:07:49.362 [info] DAP Server launched with command: /home/a/mc/.venv/bin/python /home/a/.vscode-server/extensions/ms-python.debugpy-2024.14.0-linux-x64/bundled/libs/debugpy/adapter
2025-02-02 16:07:49.440 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:07:49.443 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:07:49.444 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:07:50.646 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:07:54.204 [info] Resolving attach configuration with substituted variables
2025-02-02 16:07:54.204 [info] Using the only workspaceFolder found: /home/a/xyz/backend
2025-02-02 16:07:54.211 [info] Connecting to DAP Server at: 127.0.0.1:47921
2025-02-02 16:07:54.225 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:11:04.459 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:11:04.503 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:11:04.791 [info] DAP Server launched with command: /home/a/mc/.venv/bin/python /home/a/.vscode-server/extensions/ms-python.debugpy-2024.14.0-linux-x64/bundled/libs/debugpy/adapter
2025-02-02 16:11:04.840 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:11:04.843 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:11:04.846 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:11:05.247 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:11:08.623 [info] Resolving attach configuration with substituted variables
2025-02-02 16:11:08.623 [info] Using the only workspaceFolder found: /home/a/xyz/backend
2025-02-02 16:11:08.630 [info] Connecting to DAP Server at: 127.0.0.1:50145
2025-02-02 16:11:08.636 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:11:19.406 [info] Connecting to DAP Server at: 127.0.0.1:50145
2025-02-02 16:11:19.412 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:11:31.974 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:11:32.022 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:11:36.120 [info] Resolving launch configuration with substituted variables
2025-02-02 16:11:36.127 [info] DAP Server launched with command: /home/a/mc/.venv/bin/python /home/a/.vscode-server/extensions/ms-python.debugpy-2024.14.0-linux-x64/bundled/libs/debugpy/adapter
2025-02-02 16:11:36.183 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:11:36.188 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:11:36.189 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:11:37.276 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:11:40.774 [info] Resolving attach configuration with substituted variables
2025-02-02 16:11:40.774 [info] Using the only workspaceFolder found: /home/a/xyz/backend
2025-02-02 16:11:40.778 [info] Connecting to DAP Server at: 127.0.0.1:41579
2025-02-02 16:11:40.784 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:12:12.748 [info] Connecting to DAP Server at: 127.0.0.1:41579
2025-02-02 16:12:12.756 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:12:20.276 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:12:20.281 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:12:22.380 [info] Resolving launch configuration with substituted variables
2025-02-02 16:12:22.391 [info] DAP Server launched with command: /home/a/mc/.venv/bin/python /home/a/.vscode-server/extensions/ms-python.debugpy-2024.14.0-linux-x64/bundled/libs/debugpy/adapter
2025-02-02 16:12:22.440 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:12:22.446 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:12:22.447 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:12:23.496 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:12:26.893 [info] Resolving attach configuration with substituted variables
2025-02-02 16:12:26.893 [info] Using the only workspaceFolder found: /home/a/xyz/backend
2025-02-02 16:12:26.900 [info] Connecting to DAP Server at: 127.0.0.1:44867
2025-02-02 16:12:26.963 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:19:55.564 [info] Received 'debugpySockets' event from debugpy.
2025-02-02 16:19:55.570 [info] Received 'debugpySockets' event from debugpy.
Extension version: 2024.14.0
VS Code version: Code 1.96.4 (cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba, 2025-01-16T00:16:19.038Z)
OS version: Windows_NT x64 10.0.26100
Modes:
Remote OS version: Linux x64 5.15.167.4-microsoft-standard-WSL2
- Python version (& distribution if applicable, e.g. Anaconda): 3.8.10
- Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): VirtualEnvironment
Item | Value |
---|---|
CPUs | Intel(R) Core(TM) Ultra 5 125H (18 x 2995) |
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 webnn: disabled_off |
Load (avg) | undefined |
Memory (System) | 31.51GB (7.40GB free) |
Process Argv | --crash-reporter-id 78e27eb8-9e12-44a7-9345-018a6b09e9ad |
Screen Reader | no |
VM | 0% |
Item | Value |
---|---|
Remote | WSL: Ubuntu-20.04 |
OS | Linux x64 5.15.167.4-microsoft-standard-WSL2 |
CPUs | Intel(R) Core(TM) Ultra 5 125H (18 x 0) |
Memory (System) | 15.38GB (12.31GB free) |
VM | 0% |
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythonnoceb:30805159
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
dvdeprecation:31068756
dwnewjupyter:31046869
nativerepl2:31139839
pythonrstrctxt:31112756
nativeloc1:31192215
cf971741:31144450
iacca1:31171482
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31184530
6074i472:31201624
dwoutputs:31217127
9064b325:31222308
copilot_t_ci:31222730