Skip to content
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

Cannot read property "Threads" of null #157

Closed
DonJayamanne opened this issue Nov 14, 2017 · 3 comments · Fixed by #249
Closed

Cannot read property "Threads" of null #157

DonJayamanne opened this issue Nov 14, 2017 · 3 comments · Fixed by #249
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug
Milestone

Comments

@DonJayamanne
Copy link

From @thynquest on August 6, 2017 11:58

Environment data

VS Code version: 1.14.2
Python Extension version: 0.7.0
Python Version: 3.5
OS and version: Ubuntu 16.04

Actual behavior

when I try to debug a simple python code using the python interpreter of my virtual environment the debugger does not stop

Expected behavior

the debugger should stop on the debug point

Steps to reproduce:

  • create a virtual environment
  • launch vscode from this virtual environment and set the "python.pythonPath" property to your python interpreter defined in your virtual environment
  • create a launch.json file in order to debug
  • set debug point on your python file and lauch the debug

Logs

Output from Console window (Help->Developer Tools menu)
shell.ts:443 TypeError: Cannot read property 'Threads' of null
at PythonDebugger.threadsRequest (/home/skullalive/.vscode/extensions/donjayamanne.python-0.7.0/out/client/debugger/Main.js:364:27)
at PythonDebugger.DebugSession.dispatchRequest (/home/skullalive/.vscode/extensions/donjayamanne.python-0.7.0/node_modules/vscode-debugadapter/lib/debugSession.js:427:22)
at PythonDebugger.ProtocolServer._handleData (/home/skullalive/.vscode/extensions/donjayamanne.python-0.7.0/node_modules/vscode-debugadapter/lib/protocol.js:104:38)
at Socket. (/home/skullalive/.vscode/extensions/donjayamanne.python-0.7.0/node_modules/vscode-debugadapter/lib/protocol.js:24:60)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at Pipe.onread (net.js:551:20) : Error: TypeError: Cannot read property 'Threads' of null
at PythonDebugger.threadsRequest (/home/skullalive/.vscode/extensions/donjayamanne.python-0.7.0/out/client/debugger/Main.js:364:27)
at PythonDebugger.DebugSession.dispatchRequest (/home/skullalive/.vscode/extensions/donjayamanne.python-0.7.0/node_modules/vscode-debugadapter/lib/debugSession.js:427:22)
at PythonDebugger.ProtocolServer._handleData (/home/skullalive/.vscode/extensions/donjayamanne.python-0.7.0/node_modules/vscode-debugadapter/lib/protocol.js:104:38)
at Socket. (/home/skullalive/.vscode/extensions/donjayamanne.python-0.7.0/node_modules/vscode-debugadapter/lib/protocol.js:24:60)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at Pipe.onread (net.js:551:20)
at file:///usr/share/code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:2184338
at Object.v [as _notify] (file:///usr/share/code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:53344)
at Object.enter (file:///usr/share/code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:56836)
at n.Class.derive._oncancel._run (file:///usr/share/code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:58157)
at n.Class.derive._oncancel._error (file:///usr/share/code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:57674)
at file:///usr/share/code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:1972432
at g.e.dispatch (file:///usr/share/code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:1973783)
at g.e.handleData (file:///usr/share/code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:1973291)
at Socket. (file:///usr/share/code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:1972292)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
e.onUnexpectedError @ shell.ts:443
(anonymous) @ shell.ts:403
e.onUnexpectedError @ errors.ts:119
o @ errors.ts:139
done @ winjs.base.raw.js:1378
v @ winjs.base.raw.js:1224
enter @ winjs.base.raw.js:901
_run @ winjs.base.raw.js:1068
_chainedError @ winjs.base.raw.js:1031
n @ winjs.base.raw.js:736
then @ winjs.base.raw.js:1436
enter @ winjs.base.raw.js:747
_run @ winjs.base.raw.js:1068
_setCompleteValue @ winjs.base.raw.js:1052
v @ winjs.base.raw.js:1209
enter @ winjs.base.raw.js:901
_run @ winjs.base.raw.js:1068
_error @ winjs.base.raw.js:1041
(anonymous) @ v8Protocol.ts:53
e.dispatch @ v8Protocol.ts:136
e.handleData @ v8Protocol.ts:104
(anonymous) @ v8Protocol.ts:41
emitOne @ events.js:96
emit @ events.js:188
readableAddChunk @ _stream_readable.js:176
Readable.push @ _stream_readable.js:134
onread @ net.js:551
index.js:41 [uncaught exception]: Error: write EPIPE
onError @ index.js:41
(anonymous) @ index.js:110
emitOne @ events.js:96
emit @ events.js:188
window.onerror @ /usr/share/code/resources/electron.asar/renderer/init.js:124
i.globals.onerror @ errorTelemetry.ts:64
index.js:44 Error: write EPIPE
at exports._errnoException (util.js:1022)
at WriteWrap.afterWrite [as oncomplete] (net.js:804)
onError @ index.js:44
(anonymous) @ index.js:110
emitOne @ events.js:96
emit @ events.js:188
window.onerror @ /usr/share/code/resources/electron.asar/renderer/init.js:124
i.globals.onerror @ errorTelemetry.ts:64
events.js:160 Uncaught Error: write EPIPE
at exports._errnoException (util.js:1022)
at WriteWrap.afterWrite [as oncomplete] (net.js:804)
exports._errnoException @ util.js:1022
afterWrite @ net.js:804

Copied from original issue: DonJayamanne/pythonVSCode#1142

@DonJayamanne
Copy link
Author

From @thynquest on August 6, 2017 12:9

here is the code I'm trying to debug with no success

import os

result = os.path.abspath(file)
x = os.path.dirname(result)
y = os.path.dirname(x)
print(result)
print(x)
print(y)

thank you for your help

@DonJayamanne
Copy link
Author

From @thynquest on August 6, 2017 12:39

even a simpler line like "print("hello world")' does not work

@DonJayamanne
Copy link
Author

DonJayamanne commented Nov 14, 2017

Good new @thynquest I have managed to reproduce the same error using a different technique:

  • Set interpreter to Python3
  • Debug a python file with the code print "1234" (note parenthesis is missing)

I'll check if this can be reproduced on PTVS (Visual Studio).

@DonJayamanne DonJayamanne added the bug Issue identified by VS Code Team member as probable bug label Nov 14, 2017
@DonJayamanne DonJayamanne added this to the December 2017 milestone Nov 17, 2017
DonJayamanne added a commit that referenced this issue Nov 22, 2017
#249)

- Fixes #25, #32, #35, #235, #242 (unable to run without debugging using CTRL+F5)   
- Fixes #191, #158, #24, #136  (error message displayed when debugged code terminates)  
- Fixes #157 (debugger crashes when python program does not launch)
- Fixes #114, #149, #250 (use vscode infrastructure to launch debugger in integrated and external terminals)  
- Fixes #239 Remove prompt added to pause terminal upon program completion
@lock lock bot locked as resolved and limited conversation to collaborators Jul 12, 2018
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

Successfully merging a pull request may close this issue.

2 participants