microsoft / microsoft/vscode-python-debugger

Code executed in debug console ignores breakpoints

Đang mở
#760 4 bình luận 1 reaction 1 người được giao Xem trên GitHub

@eleanorjboyd đang làm issue này rồi.

Từ ngày 14/8/2025.

triage-needed
Ngôn ngữ chính
TypeScript
Star
180
Fork
126
Merge trung bình
2 ngày 3 giờ
Pull request đã merge (30 ngày)
3

Mô tả

Type: Bug

Behaviour

Code executed in python debug console does not trigger breakpoints

Steps to reproduce:

  1. main.py
import time



def hello():
    print("hello, world")


if __name__ == "__main__":
    hello()
    while True:
        time.sleep(1)
  1. Set breakpoint on print("hello, world")

  2. launch.json

{
    // 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 Debugger: Current File",
            "type": "debugpy",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
        }
    ]
}

  1. Start debug, and run the following code in debug console:
import main
main.hello()
  1. The breakpoint is not triggered

Diagnostic data

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

2025-07-22 14:51:48.745 [info] Experiment 'pythonSurveyNotification' is active
2025-07-22 14:51:48.745 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2025-07-22 14:51:48.745 [info] Native locator: Refresh started
2025-07-22 14:51:48.745 [info] Native locator: Refresh started
2025-07-22 14:51:48.745 [info] Native locator: Refresh started
2025-07-22 14:51:49.264 [info] > pyenv which python
2025-07-22 14:51:49.264 [info] cwd: .
2025-07-22 14:51:49.290 [info] > python -c "import sys;print(sys.executable)"
2025-07-22 14:51:49.296 [info] Native locator: Refresh finished in 626 ms
2025-07-22 14:51:49.307 [info] > pyenv which python
2025-07-22 14:51:49.307 [info] cwd: .
2025-07-22 14:51:49.334 [info] Python interpreter path: /bin/python
2025-07-22 14:51:50.360 [info] Starting Pylance language server.
2025-07-22 14:52:09.457 [info] Discover tests for workspace name: dbgtest - uri: /home/duoduo/Documents/a3/dbgtest/main.py
2025-07-22 14:52:12.126 [info] Discover tests for workspace name: dbgtest - uri: /home/duoduo/Documents/a3/dbgtest/main.py
2025-07-22 14:52:32.892 [info] Discover tests for workspace name: dbgtest - uri: /home/duoduo/Documents/a3/dbgtest/main.py
2025-07-22 14:52:37.705 [info] Experiment 'pythonSurveyNotification' is active
2025-07-22 14:52:37.705 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2025-07-22 14:52:37.705 [info] Native locator: Refresh started
2025-07-22 14:52:38.120 [info] > pyenv which python
2025-07-22 14:52:38.120 [info] cwd: .
2025-07-22 14:52:40.938 [info] Python interpreter path: /bin/python
2025-07-22 14:52:41.019 [info] Native locator: Refresh finished in 3394 ms
2025-07-22 14:52:41.804 [info] Starting Pylance language server.
2025-07-22 14:53:07.605 [info] Discover tests for workspace name: dbgtest - uri: /home/duoduo/Documents/a3/dbgtest/main.py
2025-07-22 14:53:37.550 [info] Discover tests for workspace name: dbgtest - uri: /home/duoduo/Documents/a3/dbgtest/main.py
2025-07-22 14:59:14.230 [info] Discover tests for workspace name: dbgtest - uri: /home/duoduo/Documents/a3/dbgtest/main.py

Extension version: 2025.10.1
VS Code version: Code 1.102.1 (7adae6a56e34cb64d08899664b814cf620465925, 2025-07-15T16:41:17.147Z)
OS version: Linux x64 6.15.6-200.fc42.x86_64
Modes:

  • Python version (& distribution if applicable, e.g. Anaconda): 3.13.3
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): System
  • Value of the python.languageServer setting: Default
User Settings


languageServer: "Pylance"

Installed Extensions
Extension Name Extension Id Version
astro-vscode ast 2.15.4
black-formatter ms- 2025.2.0
cmake-tools ms- 1.21.36
copilot Git 1.346.0
copilot-chat Git 0.29.1
cpptools ms- 1.26.3
cpptools-extension-pack ms- 1.3.1
cpptools-themes ms- 2.0.0
debugpy ms- 2025.10.0
gitlens eam 17.3.1
go gol 0.48.0
js-debug ms- 1.102.0
js-debug-companion ms- 1.1.3
LiveServer rit 5.7.9
python ms- 2025.10.1
redis-for-vscode Red 1.4.0
remote-explorer ms- 0.5.0
remote-ssh ms- 0.120.0
remote-ssh-edit ms- 0.87.0
vscode-eslint dba 3.0.10
vscode-js-profile-table ms- 1.0.10
vscode-pylance ms- 2025.6.2
vscode-python-envs ms- 1.0.0
vscode-tailwindcss bra 0.14.25
vsliveshare ms- 1.0.5948
System Info
Item Value
CPUs Intel(R) Core(TM) Ultra 7 155H (22 x 3633)
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: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
webnn: disabled_off
Load (avg) 1, 1, 1
Memory (System) 30.80GB (12.90GB free)
Process Argv /home/duoduo/Documents/a3/a3-backend-job --crash-reporter-id b3415946-ff07-4a99-9884-8a393e71426c
Screen Reader no
VM 0%
DESKTOP_SESSION plasma
XDG_CURRENT_DESKTOP KDE
XDG_SESSION_DESKTOP KDE
XDG_SESSION_TYPE wayland
A/B Experiments
vsliv368cf:30146710
pythonvspyt551:31249599
binariesv615:30325510
962ge761:31350689
2e7ec940:31000449
nativeloc1:31344060
5fd0e150:31155592
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
hdaa2157:31222309
copilot_t_ci:31333650
e5gg6876:31282496
pythoneinst12:31285622
c7cif404:31314491
pythonpulldiag:31343502
996jf627:31283433
pythonrdcb7:31342333
usemplatestapi:31297334
0aa6g176:31307128
747dc170:31275177
aj953862:31281341
generatesymbolt:31295002
convertfstringf:31295003
pylancequickfixt:31350061
9d2cg352:31346308
usemarketplace:31343026
nesew2to5:31336538
agentclaude:31350858
nes-diff-11:31337487
replacestringexc:31350595
nes-set-on:31350020
63221493:31336333
yijiwantestdri0626-t:31336930
0927b901:31350571
ji9b5146:31348712
7g84e740:31350607
7ji1b882:31349954
05h3e699-none:31350620

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.