Skip to content

Python debugging not working after 2019.1.0 update with stopOnEntry=true #4223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tchapin opened this issue Jan 30, 2019 · 25 comments
Closed
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug

Comments

@tchapin
Copy link

tchapin commented Jan 30, 2019

Environment data

  • VS Code version: 1.30.2
  • Extension version (available under the Extensions sidebar): 2019.1.0
  • OS and version: Windows 10 64-bit
  • Python version (& distribution if applicable, e.g. Anaconda): 2.7 and 3.6.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda

Expected behaviour

Pressing run (F5) from the debug toolbar runs the script.

Actual behaviour

Pressing run (F5) from the debug toolbar does nothing.

Steps to reproduce:

  1. setup a launch config using pythonPath to point to the python.exe to use
  2. set python.pythonPath in workspace settings to point to the same python.exe
  3. run a script

Logs

no output

@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Jan 30, 2019
@tchapin
Copy link
Author

tchapin commented Jan 30, 2019

Reverting back to 2018.12.1 works like normal.

@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Jan 30, 2019
@DonJayamanne DonJayamanne added triage-needed Needs assignment to the proper sub-team and removed triage labels Jan 30, 2019
@bcxpro

This comment has been minimized.

@d3r3kk d3r3kk added the triage label Jan 30, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Jan 30, 2019
@DonJayamanne
Copy link

@tchapin Are you also using pipenv?
@bcxpro The issue you are experiencing is a dup of #4203

@tchapin
Copy link
Author

tchapin commented Jan 30, 2019

@DonJayamanne No, not using pipenv

@ericsnowcurrently
Copy link

@tchapin, does anything get run in the terminal ("Python Debug Console")? Please paste your launch config and your settings.

@ericsnowcurrently ericsnowcurrently added area-debugging info-needed Issue requires more information from poster labels Feb 4, 2019
@tchapin
Copy link
Author

tchapin commented Feb 5, 2019

@ericsnowcurrently There is no output to the debug console. The run button seemingly does nothing.
Launch Config:

{
    // 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 2.7 (10.6)",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "pythonPath": "C:\\Python27\\ArcGIS10.6\\python.exe",
            "stopOnEntry": true,
            "console": "none"
        },
    ]
}

User Settings:

{
   // Whether to lint Python files.
  "python.linting.enabled": true,
  // Whether to lint Python files using pylint.
  "python.linting.pylintEnabled": false,
  // Arguments passed in. Each argument is a separate item in the array.
  "python.linting.pylintArgs": ["--ignore=C0301"],
  // Whether to lint Python files using flake8
  "python.linting.flake8Enabled": true,
  // Arguments passed in. Each argument is a separate item in the array.
  "python.linting.flake8Args": ["--ignore=E501, E402"],
  // Whether to lint Python files using pep8
  "python.linting.pep8Enabled": true,
  // Arguments passed in. Each argument is a separate item in the array.
  "python.linting.pep8Args": [
    "--ignore=E501, E402"
  ],
  // Configure glob patterns for excluding files and folders.
  "files.exclude": {
    "**/*.pyc": true,
    "**/*.xml": true
  },
  // Configure file associations to languages (e.g. "*.extension": "html"). These have precedence over the default associations of the languages installed.
  "files.associations": {
    "*.pyt": "python"
  },
  "workbench.startupEditor": "newUntitledFile",
  "window.zoomLevel": 0,
  "git.ignoreMissingGitWarning": true,
  "window.titleBarStyle": "custom"
}

Workspace Settings:

{
    "python.pythonPath": "C:\\Python27\\ArcGIS10.6\\python.exe"
}

@ericsnowcurrently ericsnowcurrently removed the info-needed Issue requires more information from poster label Feb 5, 2019
@Mmdixon

This comment has been minimized.

@DonJayamanne

This comment has been minimized.

@Mmdixon

This comment has been minimized.

@kraigb
Copy link

kraigb commented Feb 10, 2019

To add to this thread, "stopOnEntry" : true seems to also be a culprit, as discussed on microsoft/vscode-docs#2386. . Removing that line lets the debugger work normally.

@tchapin
Copy link
Author

tchapin commented Feb 11, 2019

I can confirm, commenting out "stopOnEntry": true in the launch.json successfully resolves the debugger problem in 2019.1.0

A workaround would be putting a breakpoint at the first executable line to simulate the effect of stopOnEntry

@fearedbliss

This comment has been minimized.

@Kurolox

This comment has been minimized.

@DonJayamanne DonJayamanne changed the title Python debugging not working after 2019.1.0 update Python debugging not working after 2019.1.0 update with stopOnEntry=true Feb 14, 2019
@ericsnowcurrently
Copy link

There's an upstream (ptvsd) bug that is causing the debugger to stop improperly when stopOnEntry is set to true. Once that is fixed upstream and pulled into the extension we'll let you know.

@ericsnowcurrently

This comment has been minimized.

@ericsnowcurrently

This comment has been minimized.

@ericsnowcurrently ericsnowcurrently added bug Issue identified by VS Code Team member as probable bug upstream-ptvsd and removed triage labels Feb 20, 2019
@ericsnowcurrently ericsnowcurrently removed their assignment Feb 20, 2019
@fearedbliss

This comment has been minimized.

@Kurolox

This comment has been minimized.

@louyihua

This comment has been minimized.

@fearedbliss

This comment has been minimized.

@fearedbliss

This comment has been minimized.

@ericsnowcurrently

This comment has been minimized.

@IDcard51373
Copy link

I can confirm, commenting out "stopOnEntry": true in the launch.json successfully resolves the debugger problem in 2019.1.0
A workaround would be putting a breakpoint at the first executable line to simulate the effect of stopOnEntry

That's how I deal with this problem now,,,,

I am a rookie Pythoner and juet started learning VSCode several days ago.
I study just according to https://code.visualstudio.com/docs/python/python-tutorial#_configure-and-run-the-debugger.
It took me lots of time to figure out why the DOC can work successfully while I couldn't even start......
I would have thought it was my Incorrect operation caused this problem....

@berkobob
Copy link

An alternative work around that works for me is to not install the virtual environment in the main project folder but to use a sub directory instead.

@DonJayamanne
Copy link

Closing as the upstream issue has been resolved.

@ghost ghost removed the needs upstream fix label Mar 25, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Apr 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests