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.

"Restart" in Python debugger does not always exit existing process before starting a new one

See original GitHub issue

Environment data

  • VS Code version: Code 1.24.1 (24f62626b222e9a8313213fb64b10d741a326288, 2018-06-13T17:51:32.889Z)
  • Extension version (available under the Extensions sidebar): 2018.6.0
  • OS and version: Windows_NT x64 10.0.15063
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.6.5
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): n/a
  • Relevant/affected Python packages and their versions: n/a

Actual behavior

Every once in a while, clicking “Restart” in the debugger will not actually restart the existing application. Instead, it will spawn a new debug console and a new instance of the application while the old instance continues to run in the previous debug console.

Expected behavior

Clicking “Restart” on the debugger toolbar should exit the currently running Python process being debugged before starting a new one.

Steps to reproduce:

Create a Python debug configuration like this:

{
            "name": "Run Server",
            "type": "python",
            "request": "launch",
            "program": "${workspaceFolder}\\app.py",
}

Now, start your Python application in the debugger.

Try to restart it.

I have not found any consistent way to reproduce this issue - it seems to be random. I will update this issue if I notice a factor that reliably reproduces the issue. It happens about 1 out of every 8 times I restart the application in the debugger.

Logs

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

N/A - the output is the normal output from the linter, nothing else.

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

This is the only error:

image

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
DonJayamannecommented, Sep 27, 2018

@flotwig I believe the issue has been resolved. Please could you test this issue with our latest development version of the extension. Instructions for installation of this dev version can be found here https://github.com/Microsoft/vscode-python/blob/master/CONTRIBUTING.md#development-build.

Please feel free to reopen the issue if this persists, else just ping on the issue and we’ll re-open it.

1reaction
flotwigcommented, Oct 8, 2018

Yes, I think it has been resolved as I was unable to reproduce it for a while after our last talk. Thanks so much guys!

Read more comments on GitHub >

github_iconTop Results From Across the Web

After code change, how to start over debugging without ...
You can use the run pdb command, which stops the existing process and starts a new one. You still have to specify the...
Read more >
pdb — The Python Debugger
Automatic restarting preserves pdb's state (such as breakpoints) and in most cases is more useful than quitting the debugger upon program's exit. New...
Read more >
Debugging configurations for Python apps in Visual Studio Code
Switch to the Run and Debug view (Ctrl+Shift+D), select the appropriate configuration from the debugger dropdown list, and start the debugger. The debugger...
Read more >
Advanced Python Debugging with pdb
To start execution, you use the continue or c command. If the program executes successfully, you will be taken back to the (Pdb)...
Read more >
How To Use the Python Debugger
The Python debugger will automatically start over when it reaches the end of your program. Whenever you want to leave the pdb console,...
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