Friday, 29 June 2018

Visual Studio Code debugger for Python

I have this setting file at Visual Studio Code launch.json:

"name": "Django",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${config:python.pythonPath}",
"program": "${workspaceFolder}/manage.py",
"cwd": "${workspaceFolder}",
"args": [
    "runserver",
    "--noreload",
    "--nothreading"
],
"env": {},
"envFile": "${workspaceFolder}/.env",
"debugOptions": [
    "RedirectOutput",
    "Django"
]

When I click on Debug --> Start Debugging, it auto generates the following syntax which is different from my setting file above:

C:\Users\HP\Work\ABC>cd C:\Users\HP\Work\ABC && cmd /C "set "PYTHONIOENCODING=UTF-8" && set "PYTHONUNBUFFERED=1" && C:\Users\HP\Work\Scripts\python.exe c:\Users\HP.vscode\extensions\ms-python.python-2018.5.0\pythonFiles\PythonTools\visualstudio_py_launcher.py C:\Users\HP\Work\ABC 65530 34806ad9-833a-4524-8cd6-18ca4aa74f14 RedirectOutput,RedirectOutput,DjangoDebugging C:\Users\HP\Work\ABC/manage.py runserver --noreload --nothreading "

When executing the above debugger, it always return inconsistent error messages such as:

  • RuntimeError: Set changed size during iteration

  • raise Exception('failed to attach') Exception: failed to attach



from Visual Studio Code debugger for Python

No comments:

Post a Comment