question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Debugging not working on Insiders build of the Python extension

See original GitHub issue

Environment data

  • PTVSD version: debugpy 1.0.0b3
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.7.6 venv
  • Using VS Code or Visual Studio: VS Code 1.43.0
  • Python Extension version: 2020.4.67731-dev

Actual behavior

Debugging tries to start:

C:\Users\luabud\Apps\MVPSummit2020\tweeterapp> cmd /C "set "DEBUGPY_LAUNCHER_PORT=58504" && set "DEBUGPY_LOG_DIR=c:\Users\luabud\.vscode\extensions\ms-python.python-2020.4.67731-dev" && c:\Users\luabud\Apps\MVPSummit2020\tweeterapp\env\Scripts\python.exe c:\Users\luabud\.vscode\extensions\ms-python.python-2020.4.67731-dev\pythonFiles\lib\python\debugpy\wheels\debugpy\launcher C:\Users\luabud\Apps\MVPSummit2020\tweeterapp\manage.py runserver "

But then it shows this:

image

And this:

image

Launch.json file:

{

    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Django",
            "type": "python",
            "request": "launch",
            "program": "${workspaceFolder}\\manage.py",
            "args": [
                "runserver",
                "--noreload"
            ],
            "django": true,
            "logToFile": true
        },

    ]
}

Steps to reproduce:

  1. On Windows, have a venv selected and try to debug a Django application with the above configuration.

Logs

debugpy.adapter-4500.log debugpy.launcher-7536.log debugpy.pydevd.10892.log debugpy.pydevd.16616.log debugpy.server-10892.log debugger.vscode_d61238c6-9c58-4bfe-af6e-3b25496517dc.log

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
karthiknadigcommented, Mar 16, 2020

The issue is due to the code @int19h pointed to. This is broken in both VS Code and VS Code Insiders. This has to be addressed for it to work before next release. This does not impact current stable release.

1reaction
karthiknadigcommented, Mar 13, 2020

This occurs because debugpyAttach event returns this object:

{
                 "seq": 15,
                 "type": "event",
                 "event": "debugpyAttach",
                 "body": {
                     "name": "Subprocess 16616",
                     "type": "python",
                     "request": "attach",
                     "program": "C:\\Users\\luabud\\Apps\\MVPSummit2020\\tweeterapp\\manage.py",
                     "args": [
                         "runserver"
                     ],
                     "django": true,
                     "logToFile": true,
                     "pythonPath": "c:\\Users\\luabud\\Apps\\MVPSummit2020\\tweeterapp\\env\\Scripts\\python.exe",
                     "cwd": "c:\\Users\\luabud\\Apps\\MVPSummit2020\\tweeterapp",
                     "envFile": "c:\\Users\\luabud\\Apps\\MVPSummit2020\\tweeterapp/.env",
                     "env": {
                         "DJANGO_SETTINGS_MODULE": "tweeter3.settings.development",
                         "PYTHONIOENCODING": "UTF-8",
                         "PYTHONUNBUFFERED": "1"
                     },
                     "stopOnEntry": false,
                     "showReturnValue": true,
                     "console": "integratedTerminal",
                     "internalConsoleOptions": "neverOpen",
                     "debugOptions": [
                         "ShowReturnValue",
                         "Django",
                         "FixFilePathCase"
                     ],
                     "justMyCode": true,
                     "workspaceFolder": "c:\\Users\\luabud\\Apps\\MVPSummit2020\\tweeterapp",
                     "subProcess": true,
                     "__sessionId": "d61238c6-9c58-4bfe-af6e-3b25496517dc",
                     "subProcessId": 16616,
                     "connect": {
                         "host": "127.0.0.1",
                         "port": 58502
                     }
                 }

This should be addressed by https://github.com/microsoft/vscode-python/pull/10517 . Using the insiders build after the CI for it completes should address this issue. /cc @int19h

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS Code Debugger not working for python
Any troubleshooting tips. It seems when I do Run->"start Debugging' no command comes to terminal. Any VS Code log file that I can...
Read more >
Run and Debug Python in the Web - Visual Studio Code
Run and Debug Python code in the Web.
Read more >
Visual Studio Code Debugger not launching
When launching VS Code, if the message "Unable to start the C/C++ language server. IntelliSense features will be disabled" appears, this is ...
Read more >
Chromium Docs - Visual Studio Code Dev
For more information on debugging Python code, see here. ... This Page; Setup. Installation; Usage; Fixes for Known Issues; Useful Extensions; Color Scheme ......
Read more >
Visual Studio Code - ArchWiki
These different flavors are all built from the Code - OSS repository, ... Remove the line to solve the problem or use an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found