Skip to content

Debugger won't work when executed using pipenv, integratedTerminal and python.terminal.activateEnvironment #4463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Kurolox opened this issue Feb 20, 2019 · 9 comments
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug

Comments

@Kurolox
Copy link

Kurolox commented Feb 20, 2019

Environment data

  • VS Code version: 1.31.1 1b8e8302e405050205e69b59abb3559592bb9e60 x64
  • Extension version (available under the Extensions sidebar): 2019.1.0
  • OS and version: Arch Linux, 4.20.10-arch1-1-ARCH
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.7.2
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): pipenv version 2018.11.15.dev0
  • Relevant/affected Python packages and their versions: N/A

Expected behaviour

Starting the Python Debugger in VS Code, and being able to use it properly

Actual behaviour

After launching the debugger, it will get stuck for some time (Around 10-15 seconds), then it will display a pop-up saying Timeout waiting for debuger connection, which will prompt you to Open the launch.json configuration file. This happens on a stock launch.json configuration, though.

Steps to reproduce:

  1. Install VS Code and Pipenv
  2. Create a pipenv environment (pipenv install)
  3. Open the folder in VS Code
  4. Switch to the virtual env generated by pipenv
  5. Try to launch any application using the debugger

Other stuff to mention

{
            "name": "Python: Current File (Integrated Terminal)",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal"
        }
  • This issue seems to be deeply related to the console switching to virtualenv functionality and/or the usage of pipenv. Setting "python.terminal.activateEnvironment": false will make the debugger work properly. Another workaround is setting the terminal to externalTerminal or none, rather than integratedTerminal.
  • It is worth to mention that even if the debugger fails to actually execute the application, it will properly activate the environment in the integrated terminal.
  • The complexity of the program doesn't matter. Even a simple print("Hello world!") will cause this issue to happen.
  • I'm using pipenv with the PIPENV_VENV_IN_PROJECT=true setting, so all the virtual environments I'm generating are inside the project folders ( usually in ${workspaceFolder}/.venv)
  • Switching the active environment to a different one (like using the system-wide python at /usr/bin) will also make the debugger work properly, even with an integrated terminal and "python.terminal.activateEnvironment": true, though there's no virtualenv being activated in this scenario

Workarounds

Any of these will do.

  • Set "python.terminal.activateEnvironment": false in your settings.json
  • On the launch.json profile you're using, set up either "console": "integratedTerminal" or "console": "none"

Logs

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

There's no output

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:325 [Extension Host] debugger listening on port 40855
extensionHost.ts:231 Extension Host
extensionHost.ts:232 Debugger listening on ws://127.0.0.1:40855/cf883f6f-4133-4583-ae93-dc5edff574b3
For help, see: https://nodejs.org/en/docs/inspector

log.ts:161  INFO no standard startup: panel is active
webviewElement.ts:294 [Embedded Page] %cElectron Security Warning (Insecure Content-Security-Policy)
console.ts:134 [Extension Host] (node:11380) [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
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
console.ts:134 [Extension Host] Python Extension: Create file systemwatcher with pattern */*/python
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:/home/kuro/Documents/Programming/Python/infinity-api/infinity-api/fetcher.py>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Build the workspace interpreter watcher, Class name = h, Arg 1: <Uri:/home/kuro/Documents/Programming/Python/infinity-api/infinity-api/fetcher.py>, Return Value: <Return value cannot be serialized for logging>
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 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: Interpreters returned by CondaEnvFileService 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: Checking whether locactors have completed locating, Class name = p, , Return Value: false
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: 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":"/sbin/python","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/usr","fileHash":"988f5f64bceb4605237bad2699f85865d0bda6197ce68dd07091a09060af77a19e289a1ed2b583df01108454cca6648d542c19480874720755c75cc6f925d061","type":"Unknown","displayName":"Python 3.7.2 64-bit"}
console.ts:134 [Extension Host] Python Extension: Current value for rule currentPath is {"architecture":3,"path":"/home/kuro/Documents/Programming/Python/infinity-api/.venv/bin/python","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/home/kuro/Documents/Programming/Python/infinity-api/.venv","fileHash":"5d74f372e7c74a361768bbb2e7df8738037f8aba7a453898ee3723c34a8b797239cbbe0cc93e6722d9c1712d0751ca2cfbd2e7c09040a4db7b56b334a0c21ada","type":"Unknown"}
console.ts:134 [Extension Host] Python Extension: Current value for rule windowsRegistry is nothing
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from cachedInterpreters, {"architecture":3,"path":"/home/kuro/Documents/Programming/Python/infinity-api/.venv/bin/python","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/home/kuro/Documents/Programming/Python/infinity-api/.venv","fileHash":"5d74f372e7c74a361768bbb2e7df8738037f8aba7a453898ee3723c34a8b797239cbbe0cc93e6722d9c1712d0751ca2cfbd2e7c09040a4db7b56b334a0c21ada","type":"Unknown"}
console.ts:134 [Extension Host] Python Extension: Interpreters returned by KnownPathsService are of count 15
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"/home/kuro/Documents/Programming/Python/infinity-api/.venv/bin/python","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/home/kuro/Documents/Programming/Python/infinity-api/.venv","fileHash":"5d74f372e7c74a361768bbb2e7df8738037f8aba7a453898ee3723c34a8b797239cbbe0cc93e6722d9c1712d0751ca2cfbd2e7c09040a4db7b56b334a0c21ada","type":"Unknown"}, Arg 2: <argument cannot be serialized for logging>, Return Value: true
console.ts:134 [Extension Host] Python Extension: Rule = cachedInterpreters, result = exit
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:/home/kuro/Documents/Programming/Python/infinity-api>, Arg 2: <argument cannot be serialized for logging>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:/home/kuro/Documents/Programming/Python/infinity-api>, Arg 2: <argument cannot be serialized for logging>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:/home/kuro/Documents/Programming/Python/infinity-api>, Arg 2: <argument cannot be serialized for logging>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api
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 = 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:/home/kuro/Documents/Programming/Python/infinity-api>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:/home/kuro/Documents/Programming/Python/infinity-api>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Checking support of .NET, Class name = u, , Return Value: true
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api/infinity-api/fetcher.py
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from currentPath, {"architecture":3,"path":"/home/kuro/Documents/Programming/Python/infinity-api/.venv/bin/python","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/home/kuro/Documents/Programming/Python/infinity-api/.venv","fileHash":"5d74f372e7c74a361768bbb2e7df8738037f8aba7a453898ee3723c34a8b797239cbbe0cc93e6722d9c1712d0751ca2cfbd2e7c09040a4db7b56b334a0c21ada","type":"Unknown","cachedEntry":true}
console.ts:134 [Extension Host] Python Extension: Current value for rule system is {"architecture":3,"path":"/sbin/python","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/usr","fileHash":"988f5f64bceb4605237bad2699f85865d0bda6197ce68dd07091a09060af77a19e289a1ed2b583df01108454cca6648d542c19480874720755c75cc6f925d061","type":"Unknown","displayName":"Python 3.7.2 64-bit"}
console.ts:134 [Extension Host] Python Extension: Current value for rule currentPath is {"architecture":3,"path":"/home/kuro/Documents/Programming/Python/infinity-api/.venv/bin/python","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/home/kuro/Documents/Programming/Python/infinity-api/.venv","fileHash":"5d74f372e7c74a361768bbb2e7df8738037f8aba7a453898ee3723c34a8b797239cbbe0cc93e6722d9c1712d0751ca2cfbd2e7c09040a4db7b56b334a0c21ada","type":"Unknown","cachedEntry":true}
console.ts:134 [Extension Host] Python Extension: Current value for rule windowsRegistry is nothing
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from cachedInterpreters, {"architecture":3,"path":"/home/kuro/Documents/Programming/Python/infinity-api/.venv/bin/python","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/home/kuro/Documents/Programming/Python/infinity-api/.venv","fileHash":"5d74f372e7c74a361768bbb2e7df8738037f8aba7a453898ee3723c34a8b797239cbbe0cc93e6722d9c1712d0751ca2cfbd2e7c09040a4db7b56b334a0c21ada","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:/home/kuro/Documents/Programming/Python/infinity-api>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: Interpreters returned by CurrentPathService are of count 4
console.ts:134 [Extension Host] Python Extension: Interpreters returned by WorkspaceVirtualEnvService are of count 3
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from system, {"architecture":3,"path":"/sbin/python","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/usr","fileHash":"988f5f64bceb4605237bad2699f85865d0bda6197ce68dd07091a09060af77a19e289a1ed2b583df01108454cca6648d542c19480874720755c75cc6f925d061","type":"Unknown","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: 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":"/sbin/python","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/usr","fileHash":"988f5f64bceb4605237bad2699f85865d0bda6197ce68dd07091a09060af77a19e289a1ed2b583df01108454cca6648d542c19480874720755c75cc6f925d061","type":"Unknown","displayName":"Python 3.7.2 64-bit"}
console.ts:134 [Extension Host] Python Extension: Current value for rule currentPath is {"architecture":3,"path":"/home/kuro/Documents/Programming/Python/infinity-api/.venv/bin/python","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/home/kuro/Documents/Programming/Python/infinity-api/.venv","fileHash":"5d74f372e7c74a361768bbb2e7df8738037f8aba7a453898ee3723c34a8b797239cbbe0cc93e6722d9c1712d0751ca2cfbd2e7c09040a4db7b56b334a0c21ada","type":"Unknown","cachedEntry":true}
console.ts:134 [Extension Host] Python Extension: Current value for rule windowsRegistry is nothing
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from cachedInterpreters, {"architecture":3,"path":"/home/kuro/Documents/Programming/Python/infinity-api/.venv/bin/python","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/home/kuro/Documents/Programming/Python/infinity-api/.venv","fileHash":"5d74f372e7c74a361768bbb2e7df8738037f8aba7a453898ee3723c34a8b797239cbbe0cc93e6722d9c1712d0751ca2cfbd2e7c09040a4db7b56b334a0c21ada","type":"Unknown","cachedEntry":true}
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"/home/kuro/Documents/Programming/Python/infinity-api/.venv/bin/python","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/home/kuro/Documents/Programming/Python/infinity-api/.venv","fileHash":"5d74f372e7c74a361768bbb2e7df8738037f8aba7a453898ee3723c34a8b797239cbbe0cc93e6722d9c1712d0751ca2cfbd2e7c09040a4db7b56b334a0c21ada","type":"Unknown","cachedEntry":true}, Arg 2: undefined, Return Value: false
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: autoSelectInterpreter, Class name = g, Arg 1: <Uri:/home/kuro/Documents/Programming/Python/infinity-api>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"/home/kuro/Documents/Programming/Python/infinity-api/.venv/bin/python","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/home/kuro/Documents/Programming/Python/infinity-api/.venv","fileHash":"5d74f372e7c74a361768bbb2e7df8738037f8aba7a453898ee3723c34a8b797239cbbe0cc93e6722d9c1712d0751ca2cfbd2e7c09040a4db7b56b334a0c21ada","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":"/sbin/python","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/usr","fileHash":"988f5f64bceb4605237bad2699f85865d0bda6197ce68dd07091a09060af77a19e289a1ed2b583df01108454cca6648d542c19480874720755c75cc6f925d061","type":"Unknown","displayName":"Python 3.7.2 64-bit"}, Arg 2: undefined, Return Value: false
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
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:/home/kuro/Documents/Programming/Python/infinity-api>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: <Uri:/home/kuro/Documents/Programming/Python/infinity-api>, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"/home/kuro/Documents/Programming/Python/infinity-api/.venv/bin/python","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/home/kuro/Documents/Programming/Python/infinity-api/.venv","fileHash":"5d74f372e7c74a361768bbb2e7df8738037f8aba7a453898ee3723c34a8b797239cbbe0cc93e6722d9c1712d0751ca2cfbd2e7c09040a4db7b56b334a0c21ada","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
console.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: 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: 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 = windowsRegistry, result = runNextRule
console.ts:134 [Extension Host] Python Extension: Executing next rule from windowsRegistry
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: 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: 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 currentPath, {"architecture":3,"path":"/home/kuro/Documents/Programming/Python/infinity-api/.venv/bin/python","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/home/kuro/Documents/Programming/Python/infinity-api/.venv","fileHash":"5d74f372e7c74a361768bbb2e7df8738037f8aba7a453898ee3723c34a8b797239cbbe0cc93e6722d9c1712d0751ca2cfbd2e7c09040a4db7b56b334a0c21ada","type":"Unknown"}
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
console.ts:134 [Extension Host] Python Extension: Create file systemwatcher with pattern */*/python
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: Current value for rule system is {"architecture":3,"path":"/sbin/python","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/usr","fileHash":"988f5f64bceb4605237bad2699f85865d0bda6197ce68dd07091a09060af77a19e289a1ed2b583df01108454cca6648d542c19480874720755c75cc6f925d061","type":"Unknown","displayName":"Python 3.7.2 64-bit"}
console.ts:134 [Extension Host] Python Extension: Current value for rule currentPath is {"architecture":3,"path":"/home/kuro/Documents/Programming/Python/infinity-api/.venv/bin/python","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/home/kuro/Documents/Programming/Python/infinity-api/.venv","fileHash":"5d74f372e7c74a361768bbb2e7df8738037f8aba7a453898ee3723c34a8b797239cbbe0cc93e6722d9c1712d0751ca2cfbd2e7c09040a4db7b56b334a0c21ada","type":"Unknown"}
console.ts:134 [Extension Host] Python Extension: Current value for rule windowsRegistry is nothing
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from cachedInterpreters, {"architecture":3,"path":"/home/kuro/Documents/Programming/Python/infinity-api/.venv/bin/python","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/home/kuro/Documents/Programming/Python/infinity-api/.venv","fileHash":"5d74f372e7c74a361768bbb2e7df8738037f8aba7a453898ee3723c34a8b797239cbbe0cc93e6722d9c1712d0751ca2cfbd2e7c09040a4db7b56b334a0c21ada","type":"Unknown"}
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: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api
console.ts:134 [Extension Host] Python Extension: Selected Interpreter from system, {"architecture":3,"path":"/sbin/python","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/usr","fileHash":"988f5f64bceb4605237bad2699f85865d0bda6197ce68dd07091a09060af77a19e289a1ed2b583df01108454cca6648d542c19480874720755c75cc6f925d061","type":"Unknown","displayName":"Python 3.7.2 64-bit"}
console.ts:134 [Extension Host] Python Extension: Current value for rule workspaceEnvs is {"architecture":3,"path":"/home/kuro/Documents/Programming/Python/infinity-api/.venv/bin/python3.7","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/home/kuro/Documents/Programming/Python/infinity-api/.venv","fileHash":"5d74f372e7c74a361768bbb2e7df8738037f8aba7a453898ee3723c34a8b797239cbbe0cc93e6722d9c1712d0751ca2cfbd2e7c09040a4db7b56b334a0c21ada","envName":".venv","type":"VirtualEnv"}
console.ts:134 [Extension Host] Python Extension: Current value for rule workspaceEnvs is {"architecture":3,"path":"/home/kuro/Documents/Programming/Python/infinity-api/.venv/bin/python3.7","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/home/kuro/Documents/Programming/Python/infinity-api/.venv","fileHash":"5d74f372e7c74a361768bbb2e7df8738037f8aba7a453898ee3723c34a8b797239cbbe0cc93e6722d9c1712d0751ca2cfbd2e7c09040a4db7b56b334a0c21ada","envName":".venv","type":"VirtualEnv"}
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"/home/kuro/Documents/Programming/Python/infinity-api/.venv/bin/python","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/home/kuro/Documents/Programming/Python/infinity-api/.venv","fileHash":"5d74f372e7c74a361768bbb2e7df8738037f8aba7a453898ee3723c34a8b797239cbbe0cc93e6722d9c1712d0751ca2cfbd2e7c09040a4db7b56b334a0c21ada","type":"Unknown"}, Arg 2: undefined, Return Value: false
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: autoSelectInterpreter, Class name = g, Arg 1: undefined, Return Value: undefined
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"/home/kuro/Documents/Programming/Python/infinity-api/.venv/bin/python","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/home/kuro/Documents/Programming/Python/infinity-api/.venv","fileHash":"5d74f372e7c74a361768bbb2e7df8738037f8aba7a453898ee3723c34a8b797239cbbe0cc93e6722d9c1712d0751ca2cfbd2e7c09040a4db7b56b334a0c21ada","type":"Unknown"}, Arg 2: undefined, Return Value: false
console.ts:134 [Extension Host] Python Extension: setGlobalInterpreter, Class name = g, Arg 1: {"architecture":3,"path":"/sbin/python","version":{"raw":"3.7.2-final","major":3,"minor":7,"patch":2,"prerelease":["final"],"build":[],"version":"3.7.2-final"},"sysPrefix":"/usr","fileHash":"988f5f64bceb4605237bad2699f85865d0bda6197ce68dd07091a09060af77a19e289a1ed2b583df01108454cca6648d542c19480874720755c75cc6f925d061","type":"Unknown","displayName":"Python 3.7.2 64-bit"}, Arg 2: undefined, Return Value: false
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
console.ts:134 [Extension Host] Python Extension: autoSelectInterpreter, Class name = g, Arg 1: undefined, Return Value: undefined
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 WorkspaceVirtualEnvService are of count 3
console.ts:134 [Extension Host] Python Extension: Interpreters returned by PipEnvService are of count 1
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: Checking whether locactors have completed locating, Class name = p, , Return Value: false
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: Checking whether locactors have completed locating, Class name = p, , Return Value: false
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: Checking whether locactors have completed locating, Class name = p, , Return Value: false
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: Interpreters returned by PipEnvService are of count 1
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: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api/infinity-api/fetcher.py
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/.config/Code - OSS/User/settings.json
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, Untitled-1
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api/infinity-api/fetcher.py
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/.config/Code - OSS/User/settings.json
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, Untitled-1
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/.config/Code - OSS/User/settings.json
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, Untitled-1
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/.config/Code - OSS/User/settings.json
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, Untitled-1
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/.config/Code - OSS/User/settings.json
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api/infinity-api/fetcher.py
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, tasks
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, extension-output-#3
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, /home/kuro/Documents/Programming/Python/infinity-api
console.ts:134 [Extension Host] Python Extension: Cached data exists getEnvironmentVariables, extension-output-#3
@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Feb 20, 2019
@Kurolox Kurolox changed the title Debugger won't work when executed using integratedTerminal and python.terminal.activateEnvironment Debugger won't work when executed using pipenv, integratedTerminal and python.terminal.activateEnvironment Feb 20, 2019
@ericsnowcurrently ericsnowcurrently self-assigned this Feb 21, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Feb 21, 2019
@ericsnowcurrently
Copy link

Thanks for opening this issue and providing so much helpful details, @Kurolox. We'll look into it.

@ericsnowcurrently
Copy link

(from @fearedbliss in #4223 (comment))

I'm also experiencing the same issue. I'm on Fedora 29, Running VS Code 1.31.1, with Django, Pipenv, and 3.6.8. I've been using VS Code/Python Extension/Pipenv for months and it was fine. Reverting to the older version helped me as well, but I'm glad to update to the new version and help debug this issue.

although in my situation I don't have stop on entry and it just doesn't work. This is my current launch setting (which is the default):

  {
            "name": "Python: Django",
            "type": "python",
            "request": "launch",
            "program": "${workspaceFolder}/manage.py",
            "console": "integratedTerminal",
            "args": [
                "runserver",
                "--noreload",
                "--nothreading"
            ],
            "django": true
        },

@ericsnowcurrently
Copy link

(my response in #4223 (comment))

@Kurolox, @fearedbliss, thanks for you interest in helping us fix the problem!

It looks like the problem you are seeing isn't quite the same thing as the "stopOnEntry" bug we're addressing here. Given what you both have said, it may be pipenv related, though it could still be indirectly related to the "stopOnEntry" bug.

Regardless, @Kurolox (or @fearedbliss), would you mind opening a separate issue for the problem you are seeing. Please refer back to this issue, especially your comment and @fearedbliss's specifically. Mention me and @fearedbliss (so we get notified). You can both open new issues if you like, on the off chance that they are actually different problems. However, you probably have the same problem so let's start with one new issue.

I'd be glad to open the new issue for you, but the report will be a little less confusing if it comes from you directly. Just let me know.

If we later determine that the "stopOnEntry" bug is actually the problem for you too then we'll just close the new issue as a duplicate. However, I think it's unlikely that it's the same problem.

@Kurolox, please indicate on the new issue if you are debugging a Django app (i.e. using the default "Python: Django" launch config), like @fearedbliss is.

@fearedbliss, please indicate on the new issue if setting python.terminal.activateEnvironment to false fixes the problem for you.

You both can reply here too, but I'd rather avoid splitting the conversation across multiple issues at this point. :)

@ericsnowcurrently
Copy link

(from @fearedbliss in #4223 (comment))

@ericsnowcurrently You can open the other commit.

I tested your suggestion about activateEnvironment, I put

 "python.terminal.activateEnvironment": false

in my settings.py and it worked :D. So what does this mean exactly? Is there a regression with the activating environment stuff compared to the previous version? Or is activating the environment something new?

@ericsnowcurrently
Copy link

(from @louyihua in #4223 (comment))

@fearedbliss If python.terminal.activateEnvironment is set to true like following:

"python.terminal.activateEnvironment": true

VSCode tries to run pipenv shell every time when you launch a debug session before it runs the actual debug command line. However, doing so seems to break the actual debug command line, so you may see an incomplete command line in the integrated terminal like this:

PS C:\Users\XXX> 2019.1.0\pythonFiles\ptvsd_launcher.py' '--default' '--client' '--host' 'localhost' '--port' '1187' 'C:\Path\to\your\project/manage.py' 'runserver' '--noreload' '--nothreading' '0.0.0.0:8080'

But the completed command line should be:

PS C:\Users\XXX> cd 'c:\Path\to\your\project'; ${env:PYTHONIOENCODING}='UTF-8'; ${env:PYTHONUNBUFFERED}='1'; & 'C:\Path\to\your\venv\Scripts\python.exe' 'c:\Path\to\your\home\.vscode\extensions\ms-python.python-2019.1.0\pythonFiles\ptvsd_launcher.py' '--default' '--client' '--host' 'localhost' '--port' '1187' 'C:\Path\to\your\project/manage.py' 'runserver' '--noreload' '--nothreading' '0.0.0.0:8080'

Surely the above incomplete command line will not launch the debug server.

@ericsnowcurrently
Copy link

(from @fearedbliss in #4223 (comment))

@louyihua yup pretty much. Before the 2019.1 update, (and after 2019.1 with the activateEnvironment disabled), it has the same behavior which works correctly:

env "SOMEVARIABLE=test" /home/jon/.local/share/virtualenvs/some-app-KxCCNwHS/bin/python /home/jon/.vscode/extensions/ms-python.python-2019.1.0/pythonFiles/ptvsd_launcher.py --default --client --host localhost --port 35811 /home/jon/Projects/some-app/manage.py runserver --noreload --nothreading 0.0.0.0:5000

In my situation I am using pipenv but I never needed to activate the pipenv shell before running, it was actually perfectly fine to maintain the existing behavior which was to select the python interpreter that's inside of the pipenv shell, and then run the debugging as normal. So I'm still using the python version that I created when I ran the pipenv installation for a particular version of Python for w/e directory I'm in, but no other stuff is needed for my particular use case in VSCode.

However if after this is fixed, activating the environment still allows everything to work, I'm also fine using the default.

@ericsnowcurrently
Copy link

(from @fearedbliss in #4223 (comment))

Also I forgot to mention, in my particular situation you would see an output similar to as follows:

[jon@hello some-app]$ pipenv shell
cd /home/jon/Projects/some-app ; env SOMEVARIABLE=ok" "PYTHONIOENCODING=UTF-8" "PYTHONUNBUFFERED=1" /home/jon/.local/share/virtualenvs/some-app-KxCCNwHS/bin/python /home/jon/.vscode/extensions/ms-python.python-2019.1.0/pythonFiles/ptvsd_launcher.py --default --client --host localhost --port 34653 /home/jon/Projects/some-app/manage.py runserver --noreload --nothreading 0.0.0.0:8010 
Loading .env environment variables…
Launching subshell in virtual environment…
 . /home/jon/.local/share/virtualenvs/some-app-KxCCNwHS/bin/activate
[jon@hello some-app]$  . /home/jon/.local/share/virtualenvs/some-app-KxCCNwHS/bin/activate
(some-app) [jon@hello some-app]$ 

After this it would just basically stall and I'll get an error Timeout waiting for debugger connection. It's interesting that I see the "Loading .env environment variables…" message after I see all of the env variables and launch command. As if things are happening in a race condition fashion.

@ericsnowcurrently ericsnowcurrently added area-debugging feature-interpreter bug Issue identified by VS Code Team member as probable bug labels Feb 21, 2019
@ericsnowcurrently
Copy link

@DonJayamanne, any insights on this issue?

@DonJayamanne
Copy link

Dup of #4203

@ghost ghost removed the needs PR label Feb 21, 2019
@ericsnowcurrently ericsnowcurrently removed their assignment Feb 21, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

3 participants