1

In this two-line python code:

string = input("What's your name? ")

if string != '': print('Hello, ' + string + '!')

While I run debugging, it waits for user input. After typing a name, the Terminal (Python Debug Console) just halts there, the print() line never gets executed. See the screenshot below

The launch.json file is below (as default):

{
    // 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: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal"
        }
    ]
}

If I run this code without debugging, everything is OK.

NOTE: The debugger works fine before. This problem just happened recently. Very much appreciate any helps or hints.

3
  • Try removing the breakpoint Commented Aug 17, 2020 at 3:09
  • @eggheadlabs Since the debug function is provided by the python extension, you could try to disable other extensions and install the python extension again(or use other versions of python extensions.). refer to: github.com/microsoft/vscode-python/issues/1125 Commented Aug 17, 2020 at 7:20
  • @JillCheng Thanks for your suggestion. I've rolled the python extension back to its previous version (v2020.7.96456), then the problem is gone and everything is OK. It seems to me a bug was introduced in the latest version (v2020.8.101144). I also tried to uninstall and reinstall the latest version but the problem was still persisting. Commented Aug 17, 2020 at 20:22

1 Answer 1

2

After I rolled back the python extension to its previous version (v2020.7.96456), then the problem is gone and the debugger can advance to next line of code and then works properly.

Though I have no hard prove that why does the latest version (v2020.8.101144) cause the debugger stoping accepting user input, at least rolling back to a previous version can be a temporary remedy, until future revisions address this issue.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you! I've been struggling with this all day. As soon as I rolled back the Python extension this was resolved.
UPDATE: VSCode has fixed this terminal input issue in v2020.8.1 (20 Aug 2020) version for the Python extension.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.