-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Debugger doesn't stop after code execution ends. #2556
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
Comments
@Balky79, thanks for the report! There may be two problems going on here, let's try and tackle them one by one.
This is a bug with our latest version of the extension, and one that we will have to fix as soon as we can. Our team will triage this today and determine if we can put out a fix for it right now or provide a workaround for you.
I cannot reproduce this, as the simple reproduction case you provide is something that works without fail for me. Could you provide us with a minimum sample of code that has a reproduction on your machine? It is possible that the two issues are related so I will attempt to reproduce #2 on my machine a bit further by forcing #1 to happen alongside it. |
@d3r3kk thanks for looking into it. You are most likely correct, as I created a blank new project in a separate folder, and there it seems that Debugging Banner goes away when the script execution is performed, however it still causes a nasty .js error that I pasted above. However, just by adding the following configuration code into my launch.json I'm getting the same problem again.
In this "blank" project, I can't (just yet) reproduce the second issue, but since you changed the title to it, it seems you managed to get it. |
Apologies: I should not have changed the title as I had before. This issue will deal only with the 2nd issue I wrote up above - the problem with debugging a file that imports from a file in the same folder. The debugger banner issue is unrelated and can be ignored, I've already discovered the problem with the banner and submitted a fix. The banner doesn't come up until after a debugging session ends. Thanks for providing your launch.json block, that actually helped a lot. I can reproduce your issue where the debugger does not complete now. The |
You are correct, taking the "debugOptions" out does remove the debugging banner. However. I'm still not able to pinpoint what is causing the issue with the local modules not being loaded. And, an update on the local modules not being loaded issue: I can't figure out if there's a separate configuration for "run without debugging" where something might be not set properly. And additional update, it happens only if there's "main" used. snippet of code:
Which is actually visible from the error message:
Thanks for the help on these issues. |
Do you mean that it corrects the problem where the debugger fails to complete after code execution is completed? If so, then this issue is closed 😄 .
Interesting. In the interest of keeping our issues concise, please open a different issue for this problem. |
Well, it seems so ;) So I'd say - yes, let's close this one.
I'll open the new issue now for this. |
Environment data
Actual behavior
Running the python script fails to pick up depending local modules.
Debugging mode never finishes, and when stopped manually it causes an "error in debugger Banner" error.
Expected behavior
Everything to work as it worked with VS Code version 1.27.0
Steps to reproduce:
Create a blank .py script, and try to import script from the same folder.
Run your script.
Observe debugging banner / Trackback dump.
Logs
When used directly with a folder where python is installed:
Traceback (most recent call last): File "C:\Python35\lib\runpy.py", line 170, in _run_module_as_main "__main__", mod_spec) File "C:\Python35\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "c:\Users\istojako\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\__main__.py", line 211, in <module> singlesession=args.single_session) File "c:\Users\istojako\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\__main__.py", line 203, in main run_main(addr, name, kind, *extra, **kwargs) File "c:\Users\istojako\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\_local.py", line 37, in run_main runner(addr, name, kind == 'module', *extra, **kwargs) File "c:\Users\istojako\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\runner.py", line 32, in run set_trace=False) File "c:\Users\istojako\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\pydevd.py", line 1099, in run return self._exec(is_module, entry_point_fn, module_name, file, globals, locals) File "c:\Users\istojako\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\pydevd.py", line 1106, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "c:\Users\istojako\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydev_imps\_pydev_execfile.py", line 25, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "c:\!IgorBackup\python-automation-scripts\PyScripts\blankStart.py", line 9, in <module> import sqlite3_hello_world ImportError: No module named 'sqlite3_hello_world'
When used with Anaconda virtualenv:
Traceback (most recent call last): File "g:\Anaconda3\Lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "g:\Anaconda3\Lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "c:\Users\istojako\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\__main__.py", line 211, in <module> singlesession=args.single_session) File "c:\Users\istojako\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\__main__.py", line 203, in main run_main(addr, name, kind, *extra, **kwargs) File "c:\Users\istojako\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\_local.py", line 37, in run_main runner(addr, name, kind == 'module', *extra, **kwargs) File "c:\Users\istojako\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\runner.py", line 32, in run set_trace=False) File "c:\Users\istojako\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\pydevd.py", line 1099, in run return self._exec(is_module, entry_point_fn, module_name, file, globals, locals) File "c:\Users\istojako\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\pydevd.py", line 1106, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "c:\Users\istojako\.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd\ptvsd\_vendored\pydevd\_pydev_imps\_pydev_execfile.py", line 25, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "c:\!IgorBackup\python-automation-scripts\PyScripts\blankStart.py", line 9, in <module> import sqlite3_hello_world ModuleNotFoundError: No module named 'sqlite3_hello_world'
Output from
Console
under theDeveloper Tools
panel (toggle Developer Tools on underHelp
)The text was updated successfully, but these errors were encountered: