-
Notifications
You must be signed in to change notification settings - Fork 68
ptvsd hangs until typing in the Debug Console then fails with thread_id as Nonetype #1326
Comments
I am having the same on Mac. I commented out my whole @karthiknadig Issue #1329 did not affect me: Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/ptvsd/_vendored/pydevd/_pydevd_bundle/pydevd_comm.py", line 284, in _on_run
self.process_net_command_json(self.global_debugger_holder.global_dbg, json_contents)
File "/usr/local/lib/python3.7/site-packages/ptvsd/_vendored/pydevd/_pydevd_bundle/pydevd_process_net_command_json.py", line 137, in process_net_command_json
cmd = on_request(py_db, request)
File "/usr/local/lib/python3.7/site-packages/ptvsd/_vendored/pydevd/_pydevd_bundle/pydevd_process_net_command_json.py", line 177, in on_completions_request
self.api.request_completions(py_db, seq, thread_id, frame_id, text, line=line, column=column)
File "/usr/local/lib/python3.7/site-packages/ptvsd/_vendored/pydevd/_pydevd_bundle/pydevd_api.py", line 118, in request_completions
thread_id, internal_get_completions, seq, thread_id, frame_id, act_tok, line=line, column=column)
File "/usr/local/lib/python3.7/site-packages/ptvsd/_vendored/pydevd/pydevd.py", line 843, in post_method_as_internal_command
self.post_internal_command(internal_cmd, thread_id)
File "/usr/local/lib/python3.7/site-packages/ptvsd/_vendored/pydevd/pydevd.py", line 847, in post_internal_command
queue = self.get_internal_queue(thread_id)
File "/usr/local/lib/python3.7/site-packages/ptvsd/_vendored/pydevd/pydevd.py", line 834, in get_internal_queue
if thread_id.startswith('__frame__'):
AttributeError: 'NoneType' object has no attribute 'startswith' |
I haven't been able to reproduce, but looking at the code it seems that in |
As a note, I've been able to reproduce in a test case when it asks for completions of a frame which is no longer paused (so, it may be a race condition -- which we should account for). |
@fabioz This issue happens to me with 2019.4.12954 too. The only difference is that it does not break when I start typing something, but when I hit Enter. |
Can you provide the stack trace? A recent commit (e44dc09) fixed another issue where the thread id could be none evaluating expressions -- which I think could be the culprit in your case (same issue in a different place -- but should be fixed in master already). |
@fabioz I think the stack trace is the same. I just removed the Python extension and added it back, so I assume I have the latest version.
|
Actually, this one is not fixed (it's in a different place: Created: #1401 to deal with that as it's similar but not the same thing. |
Environment data
Actual behavior
The debugger hangs until you click in the Debug Console text entry box and start typing. At this point, the following error message appears:
Expected behavior
The debugger to run.
Other Info
I also tried the previous release, with the same issue - (61xx)
I also tried the release before that - (5xxx). The failed on another error. I can reproduce this if needed.
Steps to reproduce:
setting.json
``` { "workbench.colorTheme": "Solarized Light", "explorer.confirmDragAndDrop": false, "python.pythonPath": "/home/josh/miniconda3/envs/python-data-converter-dev/bin/python", "git.confirmSync": false, "python.formatting.provider": "autopep8", "editor.formatOnSave": true, "python.linting.flake8Enabled": true, "python.unitTest.unittestEnabled": false, "python.unitTest.pyTestEnabled": true, "python.unitTest.nosetestsEnabled": false, "python.unitTest.autoTestDiscoverOnSaveEnabled": true, "python.unitTest.pyTestPath": "pytest", "python.unitTest.pyTestArgs": [ "tests", "--no-cov" ], "files.exclude": { "**/__pycache__": true, "**/.ipynb_checkpoints": true, "**/.pytest_cache": true, "**/*.egg-info": true } } ```launch.json
``` { // 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 (Integrated Terminal)", "type": "python", "request": "launch", "program": "${file}", "console": "integratedTerminal" }, { "name": "Python: Remote Attach", "type": "python", "request": "attach", "port": 5678, "host": "localhost", "pathMappings": [ { "localRoot": "${workspaceFolder}", "remoteRoot": "." } ] }, { "name": "Python: Module", "type": "python", "request": "launch", "module": "enter-your-module-name-here", "console": "integratedTerminal" }, { "name": "Python: Django", "type": "python", "request": "launch", "program": "${workspaceFolder}/manage.py", "console": "integratedTerminal", "args": [ "runserver", "--noreload", "--nothreading" ], "django": true }, { "name": "Python: Flask", "type": "python", "request": "launch", "module": "flask", "env": { "FLASK_APP": "data_converter/webhook.py", "FLASK_ENV": "development" }, "args": [ "run", "--no-debugger", "--no-reload" ], "jinja": true }, { "name": "Python: Current File (External Terminal)", "type": "python", "request": "launch", "program": "${file}", "console": "externalTerminal" } ] } ```The text was updated successfully, but these errors were encountered: