Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Debugger Doesn't Stop At Breakpoints #1422

Closed
DonJayamanne opened this issue May 16, 2019 · 7 comments
Closed

Debugger Doesn't Stop At Breakpoints #1422

DonJayamanne opened this issue May 16, 2019 · 7 comments
Assignees
Labels

Comments

@DonJayamanne
Copy link
Contributor

@primalewden commented on Wed Mar 20 2019

Environment data

Version: 1.32.3 (system setup)
Commit: a3db5be9b5c6ba46bb7555ec5d60178ecc2eaae4
Date: 2019-03-14T23:43:35.476Z
Electron: 3.1.6
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 10.0.17763

  • VS Code version: 1.32.3
  • Extension version (available under the Extensions sidebar): 2019.2.5558
  • OS and version: Windows_NT x64 10.0.17763
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.2 (from Python.org directly)
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Relevant/affected Python packages and their versions: None

Expected behaviour

When VSCode is used to debug a Python 3.6 script I anticipate for the execution of the code to stop when a breakpoint is 'hit'.

Actual behaviour

The code simply continues running as if the breakpoint wasn't there at all

Steps to reproduce:

  1. Create an empty directory
  2. Open VSCode and start a terminal session within that directory
  3. python -m venv .
  4. Click the "Trash Can" icon associated with the currently open terminal
  5. CTRL+SHIFT+P > Python : Select Interpreter
  6. Select any available interpreter to initiate the .vscode/settings.json file
  7. Open the .vscode/settings.json file and change the "python.pythonPath": variable from the previously selected interpretter to be .\\Scripts\\python.exe
  8. Set .vscode/launch.json to have the following contents :
{
    "version": "0.2.0",
    "configurations": [{
        "name": "Python: Current File (Integrated Terminal)",
        "type": "python",
        "request": "launch",
        "program": "${file}",
        "console": "integratedTerminal"
    }, ]
}
  1. CTRL-` (open new terminal) , this should use the venv environment at this point by default, this is just to confirm that it is indeed being used.
  2. Create a simple python script , like this :
from time import sleep
count = 0
while True:
    print(f'Count = {count}')
    sleep(1)
    count += 1
  1. Add a breakpoint at any point, for testing I used line 7 ( count += 1 )
  2. Click the "Debug" icon on the left hand menu bar
  3. Click the green "play" button at the top of the panel that appears
  4. Watch the counter go up without ever stopping

Logs

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

Starting Jedi Python language engine.

Linter 'pylint' is not installed. Please install it or select another linter".
Error: Module 'pylint' not installed.

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

extensionHost.ts:330 [Extension Host] debugger listening on port 36343
console.ts:134 [Extension Host] (node:7380) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
t.log @ console.ts:134
$logExtensionHostMessage @ mainThreadConsole.ts:39
_doInvokeHandler @ rpcProtocol.ts:390
_invokeHandler @ rpcProtocol.ts:375
_receiveRequest @ rpcProtocol.ts:295
_receiveOneMessage @ rpcProtocol.ts:225
_protocol.onMessage.e @ rpcProtocol.ts:100
fire @ event.ts:584
r @ ipc.net.ts:295
e @ ipc.net.ts:302
fire @ event.ts:584
o @ ipc.net.ts:103
_socketDataListener.e @ ipc.net.ts:132
emit @ events.js:182
addChunk @ _stream_readable.js:279
readableAddChunk @ _stream_readable.js:264
Readable.push @ _stream_readable.js:219
onread @ net.js:636
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Create file systemwatcher with pattern *\python.exe
console.ts:134 [Extension Host] Python Extension: Create file systemwatcher with pattern *\*\python.exe
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Register Intepreter Watcher, Class name = f, Arg 1: <Uri:c:\\user_path\\\GitHub\bug\foo.py>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Build the workspace interpreter watcher, Class name = h, Arg 1: <Uri:c:\\user_path\\\GitHub\bug\foo.py>, Return Value: <Return value cannot be serialized for logging>
console.ts:134 [Extension Host] Python Extension: Detection of Python Interpreter for Command python3.7 and args  failed
console.ts:134 [Extension Host] Python Extension: Detection of Python Interpreter for Command python3.6 and args  failed
console.ts:134 [Extension Host] Python Extension: Detection of Python Interpreter for Command python3 and args  failed
console.ts:134 [Extension Host] Python Extension: Detection of Python Interpreter for Command python2 and args  failed
console.ts:134 [Extension Host] Python Extension: Rule = settings, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from settings
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, <No Resource>
console.ts:134 [Extension Host] Python Extension: Rule = workspaceEnvs, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from workspaceEnvs
console.ts:134 [Extension Host] Python Extension: Interpreters returned by CondaEnvFileService are of count 0
console.ts:134 [Extension Host] Python Extension: Interpreters returned by PipEnvService are of count 0
console.ts:134 [Extension Host] Python Extension: Interpreters returned by CondaEnvService are of count 0
console.ts:134 [Extension Host] Python Extension: Interpreters returned by VirtualEnvService are of count 0
console.ts:134 [Extension Host] Python Extension: Interpreters returned by WorkspaceVirtualEnvService are of count 0
console.ts:134 [Extension Host] Python Extension: Current value for rule system is {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","companyDisplayName":"Python Software Foundation","type":"Unknown","cachedEntry":true,"displayName":"Python 3.7.2 64-bit"}
console.ts:134 [Extension Host] Python Extension: Current value for rule currentPath is {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","type":"Unknown"}
console.ts:134 [Extension Host] Python Extension: Current value for rule windowsRegistry is {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","companyDisplayName":"Python Software Foundation","type":"Unknown","cachedEntry":true}
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from cachedInterpreters, {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","companyDisplayName":"Python Software Foundation","type":"Unknown","cachedEntry":true}
console.ts:134 [Extension Host] Python Extension: Interpreters returned by KnownPathsService are of count 2
console.ts:134 [Extension Host] Python Extension: Interpreters returned by CurrentPathService are of count 6
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","companyDisplayName":"Python Software Foundation","type":"Unknown","cachedEntry":true}, Arg 2: <argument cannot be serialized for logging>, Return Value: true
console.ts:134 [Extension Host] Python Extension: Rule = cachedInterpreters, result = exit
3console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:c:\\user_path\\\GitHub\bug>, Arg 2: <argument cannot be serialized for logging>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, c:user_path\\\GitHub\bug
console.ts:134 [Extension Host] Python Extension: Rule = settings, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from settings
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:c:user_path\\\GitHub\bug>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, c:\\user_path\\\GitHub\bug\foo.py
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from windowsRegistry, {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","companyDisplayName":"Python Software Foundation","type":"Unknown","cachedEntry":true}
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from currentPath, {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","type":"Unknown"}
console.ts:134 [Extension Host] Python Extension: Current value for rule system is {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","companyDisplayName":"Python Software Foundation","type":"Unknown","cachedEntry":true,"displayName":"Python 3.7.2 64-bit"}
console.ts:134 [Extension Host] Python Extension: Current value for rule currentPath is {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","type":"Unknown"}
console.ts:134 [Extension Host] Python Extension: Current value for rule windowsRegistry is {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","companyDisplayName":"Python Software Foundation","type":"Unknown","cachedEntry":true}
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from cachedInterpreters, {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","companyDisplayName":"Python Software Foundation","type":"Unknown","cachedEntry":true}
console.ts:134 [Extension Host] Python Extension: Rule = workspaceEnvs, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from workspaceEnvs
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:c:\\user_path\\\GitHub\bug>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from system, {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","companyDisplayName":"Python Software Foundation","type":"Unknown","cachedEntry":true,"displayName":"Python 3.7.2 64-bit"}
console.ts:134 [Extension Host] Python Extension: Rule = settings, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from settings
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","companyDisplayName":"Python Software Foundation","type":"Unknown","cachedEntry":true}, Arg 2: undefined, Return Value: false
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","type":"Unknown"}, Arg 2: undefined, Return Value: false
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","companyDisplayName":"Python Software Foundation","type":"Unknown","cachedEntry":true}, Arg 2: undefined, Return Value: false
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","companyDisplayName":"Python Software Foundation","type":"Unknown","cachedEntry":true,"displayName":"Python 3.7.2 64-bit"}, Arg 2: undefined, Return Value: false
console.ts:134 [Extension Host] Python Extension: Rule = windowsRegistry, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from windowsRegistry
console.ts:134 [Extension Host] Python Extension: Rule = currentPath, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from currentPath
console.ts:134 [Extension Host] Python Extension: Rule = cachedInterpreters, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from cachedInterpreters
console.ts:134 [Extension Host] Python Extension: Rule = system, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from system
4console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:c:\\user_path\\\GitHub\bug>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Rule = workspaceEnvs, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from workspaceEnvs
console.ts:134 [Extension Host] Python Extension: Current value for rule system is {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","companyDisplayName":"Python Software Foundation","type":"Unknown","cachedEntry":true,"displayName":"Python 3.7.2 64-bit"}
console.ts:134 [Extension Host] Python Extension: Current value for rule currentPath is {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","type":"Unknown"}
console.ts:134 [Extension Host] Python Extension: Current value for rule windowsRegistry is {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","companyDisplayName":"Python Software Foundation","type":"Unknown","cachedEntry":true}
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from cachedInterpreters, {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","companyDisplayName":"Python Software Foundation","type":"Unknown","cachedEntry":true}
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, c:\\user_path\\\GitHub\bug
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","companyDisplayName":"Python Software Foundation","type":"Unknown","cachedEntry":true}, Arg 2: <argument cannot be serialized for logging>, Return Value: true
console.ts:134 [Extension Host] Python Extension: Rule = cachedInterpreters, result = exit
3console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: undefined, Arg 2: <argument cannot be serialized for logging>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Rule = settings, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from settings
2console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, <No Resource>
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: undefined, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, <No Resource>
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from windowsRegistry, {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","companyDisplayName":"Python Software Foundation","type":"Unknown","cachedEntry":true}
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from currentPath, {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","type":"Unknown"}
console.ts:134 [Extension Host] Python Extension: Current value for rule system is {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","companyDisplayName":"Python Software Foundation","type":"Unknown","cachedEntry":true,"displayName":"Python 3.7.2 64-bit"}
console.ts:134 [Extension Host] Python Extension: Current value for rule currentPath is {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","type":"Unknown"}
console.ts:134 [Extension Host] Python Extension: Current value for rule windowsRegistry is {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","companyDisplayName":"Python Software Foundation","type":"Unknown","cachedEntry":true}
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from cachedInterpreters, {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","companyDisplayName":"Python Software Foundation","type":"Unknown","cachedEntry":true}
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Create file systemwatcher with pattern *\python.exe
console.ts:134 [Extension Host] Python Extension: Create file systemwatcher with pattern *\*\python.exe
console.ts:134 [Extension Host] Python Extension: Display locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Notify locators are locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Detected refreshing of Interpreters, Class name = p, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Register Intepreter Watcher, Class name = f, Arg 1: undefined, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Build the workspace interpreter watcher, Class name = h, Arg 1: undefined, Return Value: <Return value cannot be serialized for logging>
console.ts:134 [Extension Host] Python Extension: Rule = workspaceEnvs, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from workspaceEnvs
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: undefined, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Interpreters returned by WindowsRegistryService are of count 3
8console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: false
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from system, {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","companyDisplayName":"Python Software Foundation","type":"Unknown","cachedEntry":true,"displayName":"Python 3.7.2 64-bit"}
2console.ts:134 [Extension Host] Python Extension: Current value for rule workspaceEnvs is {"architecture":3,"path":"c:\\Users\\Lewden\\Documents\\GitHub\\autoDMS\\autoDMS\\Scripts\\python.exe","version":{"raw":"3.6.2-final","major":3,"minor":6,"patch":2,"prerelease":["final"],"build":[],"version":"3.6.2-final"},"sysPrefix":"c:\\Users\\Lewden\\Documents\\GitHub\\autoDMS\\autoDMS","fileHash":"87d8bf863ae820171ea8664a0634f233bc1792a3538d552fd717605bcfe46ada057270da4bff05e6f74b52c6a9b6e0adc4e11fac506df9bb4f591ad3e1acd611","envName":"autoDMS","type":"Venv"}
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","companyDisplayName":"Python Software Foundation","type":"Unknown","cachedEntry":true}, Arg 2: undefined, Return Value: false
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","type":"Unknown"}, Arg 2: undefined, Return Value: false
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","companyDisplayName":"Python Software Foundation","type":"Unknown","cachedEntry":true}, Arg 2: undefined, Return Value: false
console.ts:134 [Extension Host] Python Extension: Rule = windowsRegistry, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from windowsRegistry
console.ts:134 [Extension Host] Python Extension: Rule = currentPath, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from currentPath
console.ts:134 [Extension Host] Python Extension: Rule = cachedInterpreters, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from cachedInterpreters
3console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: undefined, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Interpreters returned by PipEnvService are of count 0
console.ts:134 [Extension Host] Python Extension: Interpreters returned by WorkspaceVirtualEnvService are of count 0
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"C:\\Python37\\python.exe","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"C:\\Python37","fileHash":"31a2f96c90a4dc592f67677203cc943f5f5fd2680e699d933f530bde5ba752473f21f42e489a2e7f4d2109df4ea7ae15cd45e55d394b8709c46b3addd0e178f2","companyDisplayName":"Python Software Foundation","type":"Unknown","cachedEntry":true,"displayName":"Python 3.7.2 64-bit"}, Arg 2: undefined, Return Value: false
console.ts:134 [Extension Host] Python Extension: Rule = system, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from system
console.ts:134 [Extension Host] Python Extension: Checking whether locactors have completed locating, Class name = p, , Return Value: true
console.ts:134 [Extension Host] Python Extension: Hide locator refreshing progress, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: All locators have completed locating, Class name = p, , Return Value: undefined
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: undefined, Return Value: undefined
6console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, c:\\user_path\\\GitHub\bug
log.ts:161  INFO no standard startup: not a new window
2console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, c:\\user_path\\\GitHub\bug\foo.py
console.ts:134 [Extension Host] Python Extension: Linter 'pylint' is not installed. Please install it or select another linter". Error: Module 'pylint' not installed.
	at f.<anonymous> (C:\Users\Lewden\.vscode\extensions\ms-python.python-2019.2.5558\out\client\extension.js:83:304215)
	at Generator.next (<anonymous>)
	at s (C:\Users\Lewden\.vscode\extensions\ms-python.python-2019.2.5558\out\client\extension.js:83:301975)
t.log @ console.ts:134
$logExtensionHostMessage @ mainThreadConsole.ts:39
_doInvokeHandler @ rpcProtocol.ts:390
_invokeHandler @ rpcProtocol.ts:375
_receiveRequest @ rpcProtocol.ts:295
_receiveOneMessage @ rpcProtocol.ts:225
_protocol.onMessage.e @ rpcProtocol.ts:100
fire @ event.ts:584
r @ ipc.net.ts:295
e @ ipc.net.ts:302
fire @ event.ts:584
o @ ipc.net.ts:103
_socketDataListener.e @ ipc.net.ts:132
emit @ events.js:182
addChunk @ _stream_readable.js:279
readableAddChunk @ _stream_readable.js:264
Readable.push @ _stream_readable.js:219
onread @ net.js:636
2console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, c:\\user_path\\\GitHub\bug

@DonJayamanne commented on Wed Mar 20 2019

Instead of creating a venv in the root directory of your project please create a sub-directory for your venv (i.e. a sub directory within your project folder).
FYI - Generally its considered a bad practice to place your source files inside of a venv.


@primalewden commented on Wed Mar 20 2019

Hello,

As per your advisement however I have relocated the source files to a separate directory from the venv directory.

I now have the following structure :
/some_dir/venv_folder
/some_dir/source_folder

I open the source_folder with VSCode and first select one of the existing Python installations I have then edit the .vscode/settings.json file as per the description above, except now I am using an absolute path leading to the Python.exe instance within the venv_folder/scripts.

When I run debug it enters that venv , verified by the (venv_folder) that precedes the path the terminal is currently in.

Even with the abstraction away from the venv folder I am experiencing the same result. Did I misunderstand your suggestion?

Thank you for your time, I really appreciate it!


@marvingreenberg commented on Wed Apr 03 2019

I'm having the same issue with a different environment - not a remote debug, no venv, python 2.7. Making a simple test_foo.py module with a unittest class works, but my test_deploycfg,py module in the same folder of the same workspace, with a few unittest.TestCase classes each with a few dozen test_ methods does not. Setting breakpoints and running a single test case with "Debug Test" code lens behaves the same as "Run Test".


@marvingreenberg commented on Wed Apr 03 2019

Here is my Developer Tools output. The first 4 entries are the failing test_deploycfg.py, where breakpoints are ignored. The next 3 entries are from debugging a single test in test_foo.py, where breakpoints are hit and stepping works fine.

console.ts:134 [Extension Host] Python Extension: Cached data exists ActivatedEnvironmentVariables, /Users/mgreenberg/wc/607.componentstore/TENA,BuildsysUtil,trunk-1.0.0,Development,source,all
console.ts:134 [Extension Host] Python Extension: getActivatedEnvironmentVariables, Class name = b, Arg 1: <Uri:/Users/mgreenberg/wc/607.componentstore/TENA,BuildsysUtil,trunk-1.0.0,Development,source,all>, Arg 2: undefined, Arg 3: undefined
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /Users/mgreenberg/wc/607.componentstore/TENA,BuildsysUtil,trunk-1.0.0,Development,source,all
log.ts:173   ERR Cannot read property 'parent' of undefined: TypeError: Cannot read property 'parent' of undefined
	at p.getHandlesToRefresh (/Applications/VScode.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:441:238)
	at p.refresh (/Applications/VScode.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:440:910)
	at define.constructor._register.s.Event.debounce (/Applications/VScode.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:437:921)
	at u.fire (/Applications/VScode.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:43:254)
	at Timeout.e.debounce.u.onFirstListenerAdd.setTimeout [as _onTimeout] (/Applications/VScode.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:39:812)
	at ontimeout (timers.js:427:11)
	at tryOnTimeout (timers.js:289:5)
	at listOnTimeout (timers.js:252:5)
	at Timer.processTimers (timers.js:212:10)
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /Users/mgreenberg/wc/607.componentstore/TENA,BuildsysUtil,trunk-1.0.0,Development,source,all
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /Users/mgreenberg/wc/607.componentstore/TENA,BuildsysUtil,trunk-1.0.0,Development,source,all/scripts/test_foo.py
log.ts:173   ERR Cannot read property 'parent' of undefined: TypeError: Cannot read property 'parent' of undefined
	at p.getHandlesToRefresh (/Applications/VScode.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:441:238)
	at p.refresh (/Applications/VScode.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:440:910)
	at define.constructor._register.s.Event.debounce (/Applications/VScode.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:437:921)
	at u.fire (/Applications/VScode.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:43:254)
	at Timeout.e.debounce.u.onFirstListenerAdd.setTimeout [as _onTimeout] (/Applications/VScode.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:39:812)
	at ontimeout (timers.js:427:11)
	at tryOnTimeout (timers.js:289:5)
	at listOnTimeout (timers.js:252:5)
	at Timer.processTimers (timers.js:212:10)

@marvingreenberg commented on Wed Apr 03 2019

And, the problem seems to be something about "Debug Test" code lens, perhaps. If I set breakpoints in a bunch of the individual tests, clicking "Debug Test" in one test method (test_generated) it is stopping at a breakpoint in a different test (test_refs)


@newdoug55 commented on Sat May 11 2019

I am having the same issue.

debug

Program will not stop at breakpoint line 5.

Here is launch.json.
image

Here is my debug file:

2:16:29 PM, 5/11/2019
Started @ Sat May 11 2019 14:16:29 GMT-0500 (Central Daylight Time)
From Client:
Content-Length: 313

{"command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"python","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-us"},"type":"request","seq":1}
To Client:
Content-Length: 761

{"seq":1,"type":"response","request_seq":1,"command":"initialize","success":true,"body":{"supportsExceptionInfoRequest":true,"supportsConfigurationDoneRequest":true,"supportsDelayedStackTraceLoading":true,"supportsConditionalBreakpoints":true,"supportsSetVariable":true,"supportsExceptionOptions":true,"supportsGotoTargetsRequest":true,"supportsEvaluateForHovers":true,"supportsModulesRequest":true,"supportsValueFormattingOptions":true,"supportsHitConditionalBreakpoints":true,"supportsSetExpression":true,"supportsLogPoints":true,"supportTerminateDebuggee":true,"supportsCompletionsRequest":true,"exceptionBreakpointFilters":[{"filter":"raised","label":"Raised Exceptions","default":false},{"filter":"uncaught","label":"Uncaught Exceptions","default":true}]}}
From Client:
Content-Length: 554

{"command":"launch","arguments":{"name":"Python: Current File","type":"python","request":"launch","program":"c:\python\test.py","console":"integratedTerminal","logToFile":true,"pythonPath":"c:/python/my_env/Scripts/python.exe","cwd":"c:\python","envFile":"c:\python/.env","stopOnEntry":false,"showReturnValue":true,"internalConsoleOptions":"neverOpen","debugOptions":["ShowReturnValue","RedirectOutput","FixFilePathCase"],"justMyCode":true,"workspaceFolder":"c:\python","__sessionId":"84ca9619-8805-496e-967a-81ec8eb39fb4"},"type":"request","seq":2}
To Client:
Content-Length: 430

{"command":"runInTerminal","arguments":{"kind":"integrated","title":"Python Debug Console","cwd":"c:\python","args":["c:/python/my_env/Scripts/python.exe","c:\Users\dplummer\.vscode\extensions\ms-python.python-2019.4.12954\pythonFiles\ptvsd_launcher.py","--default","--client","--host","localhost","--port","64446","c:\python\test.py"],"env":{"PYTHONIOENCODING":"UTF-8","PYTHONUNBUFFERED":"1"}},"type":"request","seq":2}
From Client:
Content-Length: 115

{"type":"response","seq":3,"command":"runInTerminal","request_seq":2,"success":true,"body":{"shellProcessId":7504}}
To Client:
Content-Length: 554

To Client:
{"command":"launch","arguments":{"name":"Python: Current File","type":"python","request":"launch","program":"c:\python\test.py","console":"integratedTerminal","logToFile":true,"pythonPath":"c:/python/my_env/Scripts/python.exe","cwd":"c:\python","envFile":"c:\python/.env","stopOnEntry":false,"showReturnValue":true,"internalConsoleOptions":"neverOpen","debugOptions":["ShowReturnValue","RedirectOutput","FixFilePathCase"],"justMyCode":true,"workspaceFolder":"c:\python","__sessionId":"84ca9619-8805-496e-967a-81ec8eb39fb4"},"type":"request","seq":2}
To Client:
Content-Length: 313

To Client:
{"command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"python","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-us"},"type":"request","seq":1}
To Client:
Content-Length: 130

{"type": "event", "seq": 0, "event": "output", "body": {"category": "telemetry", "output": "ptvsd", "data": {"version": "4.2.8"}}}Content-Length: 113

{"type": "response", "seq": 1, "request_seq": 2, "success": true, "command": "launch", "message": "", "body": {}}Content-Length: 865

To Client:
{"type": "response", "seq": 2, "request_seq": 1, "success": true, "command": "initialize", "message": "", "body": {"supportsCompletionsRequest": true, "supportsConditionalBreakpoints": true, "supportsConfigurationDoneRequest": true, "supportsDebuggerProperties": true, "supportsDelayedStackTraceLoading": true, "supportsEvaluateForHovers": true, "supportsExceptionInfoRequest": true, "supportsExceptionOptions": true, "supportsHitConditionalBreakpoints": true, "supportsLogPoints": true, "supportsModulesRequest": true, "supportsSetExpression": true, "supportsSetVariable": true, "supportsValueFormattingOptions": true, "supportTerminateDebuggee": true, "supportsGotoTargetsRequest": true, "exceptionBreakpointFilters": [{"filter": "raised", "label": "Raised Exceptions", "default": false}, {"filter": "uncaught", "label": "Uncaught Exceptions", "default": true}]}}Content-Length: 63

{"type": "event", "seq": 3, "event": "initialized", "body": {}}
From Client:
Content-Length: 186

{"command":"setBreakpoints","arguments":{"source":{"name":"test.py","path":"c:\python\test.py"},"lines":[5],"breakpoints":[{"line":5}],"sourceModified":false},"type":"request","seq":4}
To Client:
Content-Length: 176

{"type": "response", "seq": 4, "request_seq": 4, "success": true, "command": "setBreakpoints", "message": "", "body": {"breakpoints": [{"id": 0, "verified": true, "line": 5}]}}
From Client:
Content-Length: 99

{"command":"setExceptionBreakpoints","arguments":{"filters":["uncaught"]},"type":"request","seq":5}
To Client:
Content-Length: 130

{"type": "response", "seq": 5, "request_seq": 5, "success": true, "command": "setExceptionBreakpoints", "message": "", "body": {}}
From Client:
Content-Length: 56

{"command":"configurationDone","type":"request","seq":6}
To Client:
Content-Length: 163

To Client:
{"type": "event", "seq": 6, "event": "process", "body": {"name": "c:\python\test.py", "systemProcessId": 16204, "isLocalProcess": true, "startMethod": "launch"}}Content-Length: 124

{"type": "response", "seq": 7, "request_seq": 6, "success": true, "command": "configurationDone", "message": "", "body": {}}
From Client:
Content-Length: 46

{"command":"threads","type":"request","seq":7}
To Client:
Content-Length: 92

{"type": "event", "seq": 8, "event": "thread", "body": {"reason": "started", "threadId": 1}}Content-Length: 158

To Client:
{"type": "response", "seq": 9, "request_seq": 7, "success": true, "command": "threads", "message": "", "body": {"threads": [{"id": 1, "name": "MainThread"}]}}
To Client:
Content-Length: 110

To Client:
{"type": "event", "seq": 10, "event": "output", "body": {"output": "dog", "category": "stdout", "source": {}}}
To Client:
Content-Length: 109

To Client:
{"type": "event", "seq": 11, "event": "output", "body": {"output": "\n", "category": "stdout", "source": {}}}
To Client:
Content-Length: 110

To Client:
{"type": "event", "seq": 12, "event": "output", "body": {"output": "cat", "category": "stdout", "source": {}}}
To Client:
Content-Length: 109

To Client:
{"type": "event", "seq": 13, "event": "output", "body": {"output": "\n", "category": "stdout", "source": {}}}
To Client:
Content-Length: 111

{"type": "event", "seq": 14, "event": "output", "body": {"output": "bird", "category": "stdout", "source": {}}}
To Client:
Content-Length: 109

{"type": "event", "seq": 15, "event": "output", "body": {"output": "\n", "category": "stdout", "source": {}}}
From Client:
Content-Length: 46

{"command":"threads","type":"request","seq":8}
To Client:
Content-Length: 128

{"type": "response", "seq": 16, "request_seq": 8, "success": true, "command": "threads", "message": "", "body": {"threads": []}}
To Client:
Content-Length: 72

{"type": "event", "seq": 17, "event": "exited", "body": {"exitCode": 0}}
onEventTerminated
To Client:
Content-Length: 63

{"type": "event", "seq": 18, "event": "terminated", "body": {}}
From Client:
Content-Length: 79

{"command":"disconnect","arguments":{"restart":false},"type":"request","seq":9}
onResponseDisconnect
To Client:
Content-Length: 118

{"type": "response", "seq": 19, "request_seq": 9, "success": true, "command": "disconnect", "message": "", "body": {}}
Socket Error
check and shutdown
shutdown
killing process
check and shutdown
Kill process now
Shutting down debug session
disposing
check and shutdown

@LukeTully
Copy link

LukeTully commented May 18, 2019

I've been trying to figure this out for a little while now, in my own circumstance, and am able to hit breakpoints, but only when a given python file is in my user directory and the interpreter is /usr/bin/python. I haven't been able to debug things with /usr/lib/ckan/default/bin/python. It seems to come down to filesystem location and maybe which python interpreter.

  1. Have tried debugging files located inside my user directory using the interpreter in /usr/lib/ckan/default/bin/python (virtualenv)
  2. Have tried copying files from /usr/lib/ckan/default to my home directory and debugging them with the above interpreter
  3. I've tried a lot of things that pretty much all resulted in an indication that it was the location of the drive

@karthiknadig
Copy link
Member

@LukeTully try `"justMyCode": false" in your launch config. That should allow you to debug everything. If files are getting ignored that is probably because we try to figure out which ones are user files and which ones aren't. that detection can miss things if the path is in any of the common interpreter or standard library locations. justMyCode set to false will turn off that filtering.

@LukeTully
Copy link

LukeTully commented May 18, 2019

@karthiknadig I have enough experience to know that something this trivial would be the solution, but thank you, it solved the problem. At least this validates the debugging outcomes I was seeing!

Although I would add that I did have "Allow breakpoints everywhere" checked on in all 3 settings files through the settings UI.

@fabioz
Copy link
Contributor

fabioz commented May 20, 2019

@karthiknadig @int19h

(previous thread on this:
#1325 (comment))

So, it seems that the current implementation is still not ideal because we're still hitting this issue... I'll take another look at this using sysconfig as pointed by: #1325 (comment)

@fabioz fabioz self-assigned this May 20, 2019
@fabioz
Copy link
Contributor

fabioz commented May 20, 2019

Another thing that just occurred to me is that we should probably say that a breakpoint is not validated if the related file will not be traced and let the user know why. I'll use this issue to add this handling too.

@karthiknadig
Copy link
Member

@fabioz This might be relevant as well, for breakpoint validation. #1298

fabioz added a commit to fabioz/ptvsd that referenced this issue May 21, 2019
fabioz added a commit to fabioz/ptvsd that referenced this issue May 21, 2019
@fabioz
Copy link
Contributor

fabioz commented May 21, 2019

Note that I just provided a fix for discovering the paths to be considered standard libraries, I'll use #1298 for the breakpoints validation.

fabioz added a commit to fabioz/ptvsd that referenced this issue May 21, 2019
fabioz added a commit to fabioz/ptvsd that referenced this issue May 21, 2019
@fabioz fabioz closed this as completed in ff97921 May 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants