Repository: microsoft/ptvsd

Issue:
Debugger Doesn't Stop At Breakpoints
@primalewden commented on [Wed Mar 20 2019](https://github.com/microsoft/vscode-python/issues/4844)

## 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"
    }, ]
}
```
9.  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.
10. Create a simple python script , like this :
```
from time import sleep
count = 0
while True:
    print(f'Count = {count}')
    sleep(1)
    count += 1
```

11. Add a breakpoint at any point, for testing I used line 7 ( count += 1 )
12. Click the "Debug" icon on the left hand menu bar
13. Click the green "play" button at the top of the panel that appears
14. Watch the counter go up without ever stopping

## Logs
Output for `Python` in the `Output` panel (`View`→`Output`, 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](https://github.com/microsoft/vscode-python/issues/4844#issuecomment-474960402)

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](https://github.com/microsoft/vscode-python/issues/4844#issuecomment-474967832)

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](https://github.com/microsoft/vscode-python/issues/4844#issuecomment-479543818)

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](https://github.com/microsoft/vscode-python/issues/4844#issuecomment-479545898)

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](https://github.com/microsoft/vscode-python/issues/4844#issuecomment-479549039)

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](https://github.com/microsoft/vscode-python/issues/4844#issuecomment-491539660)

I am having the same issue.

<img width="959" alt="debug" src="https://user-images.githubusercontent.com/46818712/57574281-a395cd80-73fb-11e9-9769-e5091a015a42.PNG">

Program will not stop at breakpoint line 5.

Here is launch.json.
![image](https://user-images.githubusercontent.com/46818712/57574344-fb810400-73fc-11e9-82ab-39ecc41ec03d.png)




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





Discussion:
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
@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. 
@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.
@karthiknadig @int19h 

(previous thread on this: 
https://github.com/microsoft/ptvsd/issues/1325#issuecomment-483367663)

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: https://github.com/microsoft/ptvsd/issues/1325#issuecomment-483892311
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.
@fabioz This might be relevant as well, for breakpoint validation. https://github.com/microsoft/ptvsd/issues/1298 
Note that I just provided a fix for discovering the paths to be considered standard libraries, I'll use #1298 for the breakpoints validation.

Resolving patch:
diff --git a/src/ptvsd/__main__.py b/src/ptvsd/__main__.py
--- a/src/ptvsd/__main__.py
+++ b/src/ptvsd/__main__.py
@@ -9,7 +9,7 @@
 import runpy
 import sys
 import site
-
+import sysconfig
 
 # ptvsd can also be invoked directly rather than via -m. In this case, the
 # first entry on sys.path is the one added automatically by Python for the
@@ -31,19 +31,19 @@
 # ptvsd with that in effect, and then remove it before continuing execution.
 if __name__ == '__main__' and 'ptvsd' not in sys.modules:
     sys.path[0] = os.path.dirname(sys.path[0])
-    import ptvsd # noqa
+    import ptvsd  # noqa
     del sys.path[0]
 
-
 import pydevd
 
+import threading  # Import after pydevd.
+
 import ptvsd._remote
 import ptvsd.options
 import ptvsd.runner
 import ptvsd.version
 from ptvsd.multiproc import listen_for_subprocesses
 
-
 # When forming the command line involving __main__.py, it might be tempting to
 # import it as a module, and then use its __file__. However, that does not work
 # reliably, because __file__ can be a relative path - and when it is relative,
@@ -54,7 +54,6 @@
 # absolute path at import time.
 __file__ = os.path.abspath(__file__)
 
-
 TARGET = '<filename> | -m <module> | -c <code> | --pid <pid>'
 
 HELP = ('''ptvsd %s
@@ -73,7 +72,9 @@ def string(s):
         s = s.decode(sys.getfilesystemencoding())
     return s
 
+
 def in_range(parser, start, stop):
+
     def parse(s):
         n = parser(s)
         if start is not None and n < start:
@@ -81,9 +82,11 @@ def parse(s):
         if stop is not None and n >= stop:
             raise ValueError('must be < %s' % stop)
         return n
+
     return parse
 
-port = in_range(int, 0, 2**16)
+
+port = in_range(int, 0, 2 ** 16)
 
 pid = in_range(int, 0, None)
 
@@ -92,27 +95,38 @@ def print_help_and_exit(switch, it):
     print(HELP, file=sys.stderr)
     sys.exit(0)
 
+
 def print_version_and_exit(switch, it):
     print(ptvsd.version.__version__)
     sys.exit(0)
 
+
 def set_arg(varname, parser):
+
     def action(arg, it):
         value = parser(next(it))
         setattr(ptvsd.options, varname, value)
+
     return action
 
+
 def set_true(varname):
+
     def do(arg, it):
         setattr(ptvsd.options, varname, True)
+
     return do
 
+
 def set_target(kind, parser=None):
+
     def do(arg, it):
         ptvsd.options.target_kind = kind
         ptvsd.options.target = arg if parser is None else parser(next(it))
+
     return do
 
+
 def set_nodebug(arg, it):
     # --nodebug implies --client
     ptvsd.options.no_debug = True
@@ -124,26 +138,26 @@ def set_nodebug(arg, it):
     # ======                    ===========         ======                                  ========
 
     # Switches that are documented for use by end users.
-    (('-?', '-h', '--help'),    None,               print_help_and_exit,                    False),
-    (('-V', '--version'),       None,               print_version_and_exit,                 False),
-    ('--host',                  '<address>',        set_arg('host', string),                True),
-    ('--port',                  '<port>',           set_arg('port', port),                  False),
-    ('--wait',                  None,               set_true('wait'),                       False),
-    ('--multiprocess',          None,               set_true('multiprocess'),               False),
-    ('--log-dir',               '<path>',           set_arg('log_dir', string),             False),
+    (('-?', '-h', '--help'), None, print_help_and_exit, False),
+    (('-V', '--version'), None, print_version_and_exit, False),
+    ('--host', '<address>', set_arg('host', string), True),
+    ('--port', '<port>', set_arg('port', port), False),
+    ('--wait', None, set_true('wait'), False),
+    ('--multiprocess', None, set_true('multiprocess'), False),
+    ('--log-dir', '<path>', set_arg('log_dir', string), False),
 
     # Switches that are used internally by the IDE or ptvsd itself.
-    ('--nodebug',               None,               set_nodebug,                            False),
-    ('--client',                None,               set_true('client'),                     False),
-    ('--subprocess-of',         '<pid>',            set_arg('subprocess_of', pid),          False),
-    ('--subprocess-notify',     '<port>',           set_arg('subprocess_notify', port),     False),
+    ('--nodebug', None, set_nodebug, False),
+    ('--client', None, set_true('client'), False),
+    ('--subprocess-of', '<pid>', set_arg('subprocess_of', pid), False),
+    ('--subprocess-notify', '<port>', set_arg('subprocess_notify', port), False),
 
     # Targets. The '' entry corresponds to positional command line arguments,
     # i.e. the ones not preceded by any switch name.
-    ('',                        '<filename>',       set_target('file'),                     False),
-    ('-m',                      '<module>',         set_target('module', string),           False),
-    ('-c',                      '<code>',           set_target('code', string),             False),
-    ('--pid',                   '<pid>',            set_target('pid', pid),                 False),
+    ('', '<filename>', set_target('file'), False),
+    ('-m', '<module>', set_target('module', string), False),
+    ('-c', '<code>', set_target('code', string), False),
+    ('--pid', '<pid>', set_target('pid', pid), False),
 ]
 
 
@@ -212,6 +226,13 @@ def setup_connection():
         if os.path.exists(path) and os.path.basename(path) == 'site-packages':
             ptvsd.log.debug('Folder with "site-packages" in sys.path: {0}', path)
 
+    for path_name in {'stdlib', 'platstdlib', 'purelib', 'platlib'} & set(
+            sysconfig.get_path_names()):
+        ptvsd.log.debug('sysconfig {0}: {1}', path_name, sysconfig.get_path(path_name))
+
+    ptvsd.log.debug('os dir: {0}', os.path.dirname(os.__file__))
+    ptvsd.log.debug('threading dir: {0}', os.path.dirname(threading.__file__))
+
     opts = ptvsd.options
     pydevd.apply_debugger_options({
         'server': not opts.client,
@@ -328,13 +349,16 @@ def run_code():
 
 
 def attach_to_pid():
+
     def quoted_str(s):
         if s is None:
             return s
         assert not isinstance(s, bytes)
         unescaped = set(chr(ch) for ch in range(32, 127)) - {'"', "'", '\\'}
+
         def escape(ch):
             return ch if ch in unescaped else '\\u%04X' % ord(ch)
+
         return 'u"' + ''.join(map(escape, s)) + '"'
 
     ptvsd.log.info('Attaching to process with ID {0}', ptvsd.options.target)
diff --git a/src/ptvsd/_vendored/pydevd/_pydevd_bundle/pydevd_filtering.py b/src/ptvsd/_vendored/pydevd/_pydevd_bundle/pydevd_filtering.py
--- a/src/ptvsd/_vendored/pydevd/_pydevd_bundle/pydevd_filtering.py
+++ b/src/ptvsd/_vendored/pydevd/_pydevd_bundle/pydevd_filtering.py
@@ -7,6 +7,7 @@
 import pydevd_file_utils
 import json
 from collections import namedtuple
+from _pydev_imps._pydev_saved_modules import threading
 
 try:
     xrange  # noqa
@@ -147,11 +148,21 @@ def __init__(self):
     def _get_default_library_roots(cls):
         # Provide sensible defaults if not in env vars.
         import site
-        roots = [sys.prefix]
-        if hasattr(sys, 'base_prefix'):
-            roots.append(sys.base_prefix)
-        if hasattr(sys, 'real_prefix'):
-            roots.append(sys.real_prefix)
+
+        roots = []
+
+        try:
+            import sysconfig  # Python 2.7 onwards only.
+        except ImportError:
+            pass
+        else:
+            for path_name in set(('stdlib', 'platstdlib', 'purelib', 'platlib')) & set(sysconfig.get_path_names()):
+                roots.append(sysconfig.get_path(path_name))
+
+        # Make sure we always get at least the standard library location (based on the `os` and
+        # `threading` modules -- it's a bit weird that it may be different on the ci, but it happens).
+        roots.append(os.path.dirname(os.__file__))
+        roots.append(os.path.dirname(threading.__file__))
 
         if hasattr(site, 'getusersitepackages'):
             site_paths = site.getusersitepackages()
@@ -173,6 +184,8 @@ def _get_default_library_roots(cls):
             if os.path.exists(path) and os.path.basename(path) == 'site-packages':
                 roots.append(path)
 
+        roots.extend([os.path.realpath(path) for path in roots])
+
         return sorted(set(roots))
 
     def _normpath(self, filename):


Test patch:
diff --git a/tests/conftest.py b/tests/conftest.py
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -51,24 +51,42 @@ def pytest_report_header(config):
     else:
         print('Number of processors: %s' % (multiprocessing.cpu_count(),))
 
+    import sysconfig
+    from os.path import realpath
+
     print('Relevant system paths:')
-    print('sys.prefix: %s' % (sys.prefix,))
+    print('sys.prefix: %s (%s)' % (sys.prefix, realpath(sys.prefix)))
 
     if hasattr(sys, 'base_prefix'):
-        print('sys.base_prefix: %s' % (sys.base_prefix,))
+        print('sys.base_prefix: %s (%s)' % (
+            sys.base_prefix, realpath(sys.base_prefix)))
 
     if hasattr(sys, 'real_prefix'):
-        print('sys.real_prefix: %s' % (sys.real_prefix,))
+        print('sys.real_prefix: %s (%s)' % (
+            sys.real_prefix, realpath(sys.real_prefix)))
 
     if hasattr(site, 'getusersitepackages'):
-        print('site.getusersitepackages(): %s' % (site.getusersitepackages(),))
+        print('site.getusersitepackages(): %s (%s)' % (
+            site.getusersitepackages(), realpath(site.getusersitepackages())))
 
     if hasattr(site, 'getsitepackages'):
-        print('site.getsitepackages(): %s' % (site.getsitepackages(),))
+        print('site.getsitepackages(): %s (%s)' % (
+            site.getsitepackages(), realpath(site.getsitepackages())))
 
     for path in sys.path:
         if os.path.exists(path) and os.path.basename(path) == 'site-packages':
-            print('Folder with "site-packages" in sys.path: %s' % (path,))
+            print('Folder with "site-packages" in sys.path: %s (%s)' % (
+                path, realpath(path)))
+
+    for path_name in sorted(sysconfig.get_path_names()):
+        print('sysconfig: %s: %s (%s)' % (
+            path_name, sysconfig.get_path(path_name), realpath(sysconfig.get_path(path_name))))
+
+    print('os module dir: %s (%s)' % (
+        os.path.dirname(os.__file__), realpath(os.path.dirname(os.__file__))))
+
+    print('threading module dir: %s (%s)' % (
+        os.path.dirname(threading.__file__), realpath(os.path.dirname(threading.__file__))))
 
 
 @pytest.hookimpl(hookwrapper=True, tryfirst=True)