-
Notifications
You must be signed in to change notification settings - Fork 93
Closed as not planned
Labels
triage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
Description
Behaviour
Debug a Python file C:\Users\user\Downloads\test.py in Visual Studio Code.
Steps to reproduce:
-
Open
C:\Users\user\Downloads\test.pyin Visual Studio Code. -
Press F5.
-
The built-in terminal launched.
-
The output is printed, while it looks strange:
❯ & 'D:\Python\python.exe' 'c:\Users\user\.vscode\extensions\ms-python.python-2024.4.0\python_files\lib\python\debugpy\adapter/../..\debugpy\launcher' '55162' '--' 'C:\Users\user\Downloads\test.py' y' ;f32e748c-078e-4722-b78a-88d04fc76110y' ;f32e748c-078e-4722-b78a-88d04fc761107.098666746304519
-
However, if the Python file is run in the terminal instead of being debugged with Visual Studio Code, the issue will not occur:
❯ python C:\Users\user\Downloads\test.py 7.098666746304519
Diagnostic data
launch.json configuration
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: 当前文件",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "C/C++: gcc.exe 生成和调试活动文件",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "D:\\mingw64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "将反汇编风格设置为 Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: gcc.exe 生成活动文件"
}
]
}Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
2024-04-05 20:11:01.495 [info] DAP Server launched with command: D:\Python\python.exe c:\Users\user\.vscode\extensions\ms-python.python-2024.4.0\python_files\lib\python\debugpy\adapter
2024-04-05 20:11:03.265 [info] Send text to terminal: & 'D:\Python\python.exe' 'c:\Users\user\.vscode\extensions\ms-python.python-2024.4.0\python_files\lib\python\debugpy\adapter/../..\debugpy\launcher' '55037' '--' 'C:\Users\user\Downloads\test.py'
Output for Python Debugger in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python Debugger)
Nothing.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
triage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
