question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Calling `subprocess.run` always calls the `convert` tool, never the command specified when debugging tests

See original GitHub issue

I feel like I’ve gone insane with this one.

Whenever I run unittests via the extension (clicking “Run Test” or using the side bar), my tests pass as expected. As soon as I click “Debug Test” or use the debug button in the sidebar, calls with the subprocess module start getting weird. Instead of calling whatever I pass in, it calls the convert utility (ImageMagick). I haven’t called this anywhere in my code. I’ve never even used the tool.

Example:

class SubprocessTests(unittest.TestCase):

    def test_correct(self) -> None:
        output = subprocess.run(
            f"true", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE
        ).stdout.decode()

        self.assertTrue("magick" not in output)

When you run the test, it passes. When you debug, it fails.

I’ve managed to reproduce it in a minimal sample as well: pythontest.zip

Environment data

  • VS Code version: 1.36.1
  • Extension version (available under the Extensions sidebar): 2019.6.24221
  • OS and version: macOS 10.14.5
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.6 64 bit
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): venv
  • Relevant/affected Python packages and their versions: N/A
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info #3977): Jedi enabled

Expected behaviour

Calls to subprocess.run(command) actually call the command specified.

Actual behaviour

subprocess.run(command) appears to be actually running subprocess.run("convert X") where X is unknown (it shows the help text, and if I set check to True it throws with exit code 2.

Steps to reproduce:

  1. Unzip the zip linked above (it comes with the venv)
  2. Go to test_subprocess.py
  3. Click “Run Test” after test discovery is complete
  4. Observe it passing
  5. Click “Debug Test”
  6. Observe it failing

Logs

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

Starting Jedi Python language engine.

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

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

[Extension Host] debugger listening on port 63092
console.ts:134 [Extension Host] (node:22552) [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] Info Python Extension: 2019-08-02 14:35:18: Display locator refreshing progress, Class name = p, completed in 1ms, , Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Notify locators are locating, Class name = p, completed in 2ms, , Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Checking whether locactors have completed locating, Class name = p, completed in 0ms, , Return Value: false
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Detected refreshing of Interpreters, Class name = p, completed in 2ms, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Display locator refreshing progress, Class name = p, completed in 0ms, , Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Notify locators are locating, Class name = p, completed in 0ms, , Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Checking whether locactors have completed locating, Class name = p, completed in 0ms, , Return Value: false
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Detected refreshing of Interpreters, Class name = p, completed in 0ms, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Display locator refreshing progress, Class name = p, completed in 0ms, , Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Notify locators are locating, Class name = p, completed in 0ms, , Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Checking whether locactors have completed locating, Class name = p, completed in 0ms, , Return Value: false
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Detected refreshing of Interpreters, Class name = p, completed in 1ms, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Display locator refreshing progress, Class name = p, completed in 0ms, , Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Notify locators are locating, Class name = p, completed in 0ms, , Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Checking whether locactors have completed locating, Class name = p, completed in 0ms, , Return Value: false
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Detected refreshing of Interpreters, Class name = p, completed in 1ms, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Create file systemwatcher with pattern */python
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Create file systemwatcher with pattern */*/python
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Display locator refreshing progress, Class name = p, completed in 0ms, , Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Notify locators are locating, Class name = p, completed in 0ms, , Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Checking whether locactors have completed locating, Class name = p, completed in 0ms, , Return Value: false
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Detected refreshing of Interpreters, Class name = p, completed in 0ms, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Display locator refreshing progress, Class name = p, completed in 0ms, , Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Notify locators are locating, Class name = p, completed in 0ms, , Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Checking whether locactors have completed locating, Class name = p, completed in 0ms, , Return Value: false
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Detected refreshing of Interpreters, Class name = p, completed in 0ms, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Display locator refreshing progress, Class name = p, completed in 0ms, , Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Notify locators are locating, Class name = p, completed in 0ms, , Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Checking whether locactors have completed locating, Class name = p, completed in 0ms, , Return Value: false
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Detected refreshing of Interpreters, Class name = p, completed in 1ms, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Register Intepreter Watcher, Class name = p, completed in 4ms, Arg 1: <Uri:/Users/dalemy/Microsoft/pythontest 2/tests/test_subprocess.py>, Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Build the workspace interpreter watcher, Class name = h, completed in 5ms, Arg 1: <Uri:/Users/dalemy/Microsoft/pythontest 2/tests/test_subprocess.py>, Return Value: <Return value cannot be serialized for logging>
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Rule = settings, result = exit
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: autoSelectInterpreter, Class name = f, completed in 2ms, Arg 1: <Uri:/Users/dalemy/Microsoft/pythontest 2>, Arg 2: <argument cannot be serialized for logging>, Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Rule = windowsRegistry, result = runNextRule
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Executing next rule from windowsRegistry
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Rule = settings, result = exit
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Rule = workspaceEnvs, result = runNextRule
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Executing next rule from workspaceEnvs
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Build the workspace interpreter watcher, Class name = h, completed in 5ms, Arg 1: <Uri:/Users/dalemy/Microsoft/pythontest 2/tests/test_subprocess.py>, Return Value: <Return value cannot be serialized for logging>
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: autoSelectInterpreter, Class name = f, completed in 6ms, Arg 1: <Uri:/Users/dalemy/Microsoft/pythontest 2>, Return Value: undefined
2console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: autoSelectInterpreter, Class name = f, completed in 8ms, Arg 1: <Uri:/Users/dalemy/Microsoft/pythontest 2>, Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Detection of Python Interpreter for Command python2 and args  failed
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Selected Interpreter from currentPath, {"architecture":3,"path":"/usr/local/opt/python/bin/python3.7","version":{"raw":"3.7.4-final","major":3,"minor":7,"patch":4,"prerelease":["final"],"build":[],"version":"3.7.4-final"},"sysPrefix":"/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7","fileHash":"58b9cb8b520f720246cb3e5e6d5710a7bda9568102e931409ef216430e119d7db1d38f63af01670b5b753b9c9013cec201bd98c707bd345a8bc855b64ef7fb76","type":"Unknown","cachedEntry":true}
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Current value for rule system is {"architecture":3,"path":"/usr/local/opt/python/bin/python3.7","version":{"raw":"3.7.4-final","major":3,"minor":7,"patch":4,"prerelease":["final"],"build":[],"version":"3.7.4-final"},"sysPrefix":"/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7","fileHash":"58b9cb8b520f720246cb3e5e6d5710a7bda9568102e931409ef216430e119d7db1d38f63af01670b5b753b9c9013cec201bd98c707bd345a8bc855b64ef7fb76","type":"Unknown","displayName":"Python 3.7.4 64-bit"}
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Current value for rule currentPath is {"architecture":3,"path":"/usr/local/opt/python/bin/python3.7","version":{"raw":"3.7.4-final","major":3,"minor":7,"patch":4,"prerelease":["final"],"build":[],"version":"3.7.4-final"},"sysPrefix":"/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7","fileHash":"58b9cb8b520f720246cb3e5e6d5710a7bda9568102e931409ef216430e119d7db1d38f63af01670b5b753b9c9013cec201bd98c707bd345a8bc855b64ef7fb76","type":"Unknown","cachedEntry":true}
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Current value for rule windowsRegistry is nothing
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Selected Interpreter from cachedInterpreters, {"architecture":3,"path":"/usr/local/opt/python/bin/python3.7","version":{"raw":"3.7.4-final","major":3,"minor":7,"patch":4,"prerelease":["final"],"build":[],"version":"3.7.4-final"},"sysPrefix":"/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7","fileHash":"58b9cb8b520f720246cb3e5e6d5710a7bda9568102e931409ef216430e119d7db1d38f63af01670b5b753b9c9013cec201bd98c707bd345a8bc855b64ef7fb76","type":"Unknown","cachedEntry":true}
2console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Cached data exists getEnvironmentVariables, <No Resource>
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Activation Commands received source "/Users/dalemy/Microsoft/pythontest 2/venv/bin/activate" for shell bash
2console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Cached data exists getEnvironmentVariables, /Users/dalemy/Microsoft/pythontest 2
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Has Custom Env Vars
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Activating Environment to capture Environment variables, . "/Users/dalemy/Microsoft/pythontest 2/venv/bin/activate" && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python /Users/dalemy/.vscode/extensions/ms-python.python-2019.6.24221/pythonFiles/printEnvVariables.py
console.ts:134 [Extension Host] Error Python Extension: 2019-08-02 14:35:18: Detection of Python Interpreter for Command python3.6 and args  failed as file  does not exist
t.log @ console.ts:134
2console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Cached data exists getEnvironmentVariables, <No Resource>
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: parseEnvironmentOutput, Class name = b, completed in 0ms
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: getActivatedEnvironmentVariables, Class name = b, completed in 118ms, Arg 1: <Uri:/Users/dalemy/Microsoft/pythontest 2>, Arg 2: undefined, Arg 3: false
console.ts:134 [Extension Host] Error Python Extension: 2019-08-02 14:35:18: Failed to parse interpreter information for '/Users/dalemy/.pyenv/shims/python3.6' with JSON pyenv: python3.6: command not foundThe `python3.6' command exists in these Python versions:  3.6.9 [SyntaxError: Unexpected token p in JSON at position 0	at JSON.parse (<anonymous>)	at p.getInterpreterInformation (/Users/dalemy/.vscode/extensions/ms-python.python-2019.6.24221/out/client/extension.js:75:287807)]
t.log @ console.ts:134
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Interpreters returned by CondaEnvFileService are of count 0
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Interpreters returned by PipEnvService are of count 0
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: setGlobalInterpreter, Class name = f, completed in 129ms, Arg 1: {"architecture":3,"path":"/usr/local/opt/python/bin/python3.7","version":{"raw":"3.7.4-final","major":3,"minor":7,"patch":4,"prerelease":["final"],"build":[],"version":"3.7.4-final"},"sysPrefix":"/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7","fileHash":"58b9cb8b520f720246cb3e5e6d5710a7bda9568102e931409ef216430e119d7db1d38f63af01670b5b753b9c9013cec201bd98c707bd345a8bc855b64ef7fb76","type":"Unknown","cachedEntry":true}, Arg 2: undefined, Return Value: false
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Rule = currentPath, result = runNextRule
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Executing next rule from currentPath
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: autoSelectInterpreter, Class name = f, completed in 176ms, Arg 1: <Uri:/Users/dalemy/Microsoft/pythontest 2>, Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Selected Interpreter from system, {"architecture":3,"path":"/usr/local/opt/python/bin/python3.7","version":{"raw":"3.7.4-final","major":3,"minor":7,"patch":4,"prerelease":["final"],"build":[],"version":"3.7.4-final"},"sysPrefix":"/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7","fileHash":"58b9cb8b520f720246cb3e5e6d5710a7bda9568102e931409ef216430e119d7db1d38f63af01670b5b753b9c9013cec201bd98c707bd345a8bc855b64ef7fb76","type":"Unknown","cachedEntry":true,"displayName":"Python 3.7.4 64-bit"}
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: setGlobalInterpreter, Class name = f, completed in 152ms, Arg 1: {"architecture":3,"path":"/usr/local/opt/python/bin/python3.7","version":{"raw":"3.7.4-final","major":3,"minor":7,"patch":4,"prerelease":["final"],"build":[],"version":"3.7.4-final"},"sysPrefix":"/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7","fileHash":"58b9cb8b520f720246cb3e5e6d5710a7bda9568102e931409ef216430e119d7db1d38f63af01670b5b753b9c9013cec201bd98c707bd345a8bc855b64ef7fb76","type":"Unknown","cachedEntry":true}, Arg 2: undefined, Return Value: false
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Rule = cachedInterpreters, result = runNextRule
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Executing next rule from cachedInterpreters
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: autoSelectInterpreter, Class name = f, completed in 204ms, Arg 1: <Uri:/Users/dalemy/Microsoft/pythontest 2>, Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Interpreters returned by CondaEnvService are of count 0
3console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Checking whether locactors have completed locating, Class name = p, completed in 0ms, , Return Value: false
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Interpreters returned by WorkspaceVirtualEnvService are of count 2
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Interpreters returned by CurrentPathService are of count 4
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Interpreters returned by KnownPathsService are of count 12
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: setGlobalInterpreter, Class name = f, completed in 83ms, Arg 1: {"architecture":3,"path":"/usr/local/opt/python/bin/python3.7","version":{"raw":"3.7.4-final","major":3,"minor":7,"patch":4,"prerelease":["final"],"build":[],"version":"3.7.4-final"},"sysPrefix":"/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7","fileHash":"58b9cb8b520f720246cb3e5e6d5710a7bda9568102e931409ef216430e119d7db1d38f63af01670b5b753b9c9013cec201bd98c707bd345a8bc855b64ef7fb76","type":"Unknown","cachedEntry":true,"displayName":"Python 3.7.4 64-bit"}, Arg 2: undefined, Return Value: false
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Rule = system, result = runNextRule
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Executing next rule from system
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: autoSelectInterpreter, Class name = f, completed in 268ms, Arg 1: <Uri:/Users/dalemy/Microsoft/pythontest 2>, Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Interpreters returned by VirtualEnvService are of count 3
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Checking whether locactors have completed locating, Class name = p, completed in 0ms, , Return Value: true
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Hide locator refreshing progress, Class name = p, completed in 0ms, , Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: All locators have completed locating, Class name = p, completed in 0ms, , Return Value: undefined
6console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:18: Cached data exists getEnvironmentVariables, /Users/dalemy/Microsoft/pythontest 2
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Cached data exists getEnvironmentVariables, /Users/dalemy/Microsoft/pythontest 2/tests/test_subprocess.py
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Rule = settings, result = exit
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: autoSelectInterpreter, Class name = f, completed in 1ms, Arg 1: undefined, Arg 2: <argument cannot be serialized for logging>, Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Rule = windowsRegistry, result = runNextRule
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Executing next rule from windowsRegistry
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Rule = settings, result = exit
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Rule = workspaceEnvs, result = runNextRule
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Executing next rule from workspaceEnvs
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: autoSelectInterpreter, Class name = f, completed in 0ms, Arg 1: undefined, Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Shell path from user settings 'null'
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Shell path '/bin/zsh'
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Shell path identified as shell 'zsh'
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Shell path from user env '/bin/zsh'
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Shell identified as 'zsh'
2console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Cached data exists getEnvironmentVariables, <No Resource>
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: autoSelectInterpreter, Class name = f, completed in 4ms, Arg 1: undefined, Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: autoSelectInterpreter, Class name = f, completed in 3ms, Arg 1: undefined, Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Cached data exists getEnvironmentVariables, <No Resource>
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Selected Interpreter from currentPath, {"architecture":3,"path":"/Users/dalemy/Microsoft/pythontest 2/venv/bin/python3","version":{"raw":"3.7.4-final","major":3,"minor":7,"patch":4,"prerelease":["final"],"build":[],"version":"3.7.4-final"},"sysPrefix":"/Users/dalemy/Microsoft/pythontest 2/venv","fileHash":"6c18931ffbde75f6adb90e3953dbf8edee26a8c76d82b08de0e0aa7630e26781bf0cf7066a9a369cc7897caaf1641620614ccb8eb83ebbc62811f6da2da07870","type":"Unknown"}
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Display locator refreshing progress, Class name = p, completed in 1ms, , Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Notify locators are locating, Class name = p, completed in 1ms, , Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Checking whether locactors have completed locating, Class name = p, completed in 0ms, , Return Value: false
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Detected refreshing of Interpreters, Class name = p, completed in 1ms, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Create file systemwatcher with pattern */python
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Create file systemwatcher with pattern */*/python
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Display locator refreshing progress, Class name = p, completed in 0ms, , Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Notify locators are locating, Class name = p, completed in 0ms, , Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Checking whether locactors have completed locating, Class name = p, completed in 0ms, , Return Value: false
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Detected refreshing of Interpreters, Class name = p, completed in 0ms, Arg 1: {}, Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Register Intepreter Watcher, Class name = p, completed in 1ms, Arg 1: undefined, Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Build the workspace interpreter watcher, Class name = h, completed in 1ms, Arg 1: undefined, Return Value: <Return value cannot be serialized for logging>
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Current value for rule system is {"architecture":3,"path":"/usr/local/opt/python/bin/python3.7","version":{"raw":"3.7.4-final","major":3,"minor":7,"patch":4,"prerelease":["final"],"build":[],"version":"3.7.4-final"},"sysPrefix":"/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7","fileHash":"58b9cb8b520f720246cb3e5e6d5710a7bda9568102e931409ef216430e119d7db1d38f63af01670b5b753b9c9013cec201bd98c707bd345a8bc855b64ef7fb76","type":"Unknown","displayName":"Python 3.7.4 64-bit"}
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Current value for rule currentPath is {"architecture":3,"path":"/Users/dalemy/Microsoft/pythontest 2/venv/bin/python3","version":{"raw":"3.7.4-final","major":3,"minor":7,"patch":4,"prerelease":["final"],"build":[],"version":"3.7.4-final"},"sysPrefix":"/Users/dalemy/Microsoft/pythontest 2/venv","fileHash":"6c18931ffbde75f6adb90e3953dbf8edee26a8c76d82b08de0e0aa7630e26781bf0cf7066a9a369cc7897caaf1641620614ccb8eb83ebbc62811f6da2da07870","type":"Unknown"}
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Current value for rule windowsRegistry is nothing
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Selected Interpreter from cachedInterpreters, {"architecture":3,"path":"/Users/dalemy/Microsoft/pythontest 2/venv/bin/python3","version":{"raw":"3.7.4-final","major":3,"minor":7,"patch":4,"prerelease":["final"],"build":[],"version":"3.7.4-final"},"sysPrefix":"/Users/dalemy/Microsoft/pythontest 2/venv","fileHash":"6c18931ffbde75f6adb90e3953dbf8edee26a8c76d82b08de0e0aa7630e26781bf0cf7066a9a369cc7897caaf1641620614ccb8eb83ebbc62811f6da2da07870","type":"Unknown"}
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Selected Interpreter from system, {"architecture":3,"path":"/usr/local/opt/python/bin/python3.7","version":{"raw":"3.7.4-final","major":3,"minor":7,"patch":4,"prerelease":["final"],"build":[],"version":"3.7.4-final"},"sysPrefix":"/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7","fileHash":"58b9cb8b520f720246cb3e5e6d5710a7bda9568102e931409ef216430e119d7db1d38f63af01670b5b753b9c9013cec201bd98c707bd345a8bc855b64ef7fb76","type":"Unknown","displayName":"Python 3.7.4 64-bit"}
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: setGlobalInterpreter, Class name = f, completed in 22ms, Arg 1: {"architecture":3,"path":"/Users/dalemy/Microsoft/pythontest 2/venv/bin/python3","version":{"raw":"3.7.4-final","major":3,"minor":7,"patch":4,"prerelease":["final"],"build":[],"version":"3.7.4-final"},"sysPrefix":"/Users/dalemy/Microsoft/pythontest 2/venv","fileHash":"6c18931ffbde75f6adb90e3953dbf8edee26a8c76d82b08de0e0aa7630e26781bf0cf7066a9a369cc7897caaf1641620614ccb8eb83ebbc62811f6da2da07870","type":"Unknown"}, Arg 2: undefined, Return Value: false
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Rule = currentPath, result = runNextRule
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Executing next rule from currentPath
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: autoSelectInterpreter, Class name = f, completed in 35ms, Arg 1: undefined, Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Interpreters returned by PipEnvService are of count 0
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: setGlobalInterpreter, Class name = f, completed in 22ms, Arg 1: {"architecture":3,"path":"/Users/dalemy/Microsoft/pythontest 2/venv/bin/python3","version":{"raw":"3.7.4-final","major":3,"minor":7,"patch":4,"prerelease":["final"],"build":[],"version":"3.7.4-final"},"sysPrefix":"/Users/dalemy/Microsoft/pythontest 2/venv","fileHash":"6c18931ffbde75f6adb90e3953dbf8edee26a8c76d82b08de0e0aa7630e26781bf0cf7066a9a369cc7897caaf1641620614ccb8eb83ebbc62811f6da2da07870","type":"Unknown"}, Arg 2: undefined, Return Value: false
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Rule = cachedInterpreters, result = runNextRule
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Executing next rule from cachedInterpreters
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Checking whether locactors have completed locating, Class name = p, completed in 0ms, , Return Value: false
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: autoSelectInterpreter, Class name = f, completed in 40ms, Arg 1: undefined, Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: setGlobalInterpreter, Class name = f, completed in 19ms, Arg 1: {"architecture":3,"path":"/usr/local/opt/python/bin/python3.7","version":{"raw":"3.7.4-final","major":3,"minor":7,"patch":4,"prerelease":["final"],"build":[],"version":"3.7.4-final"},"sysPrefix":"/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7","fileHash":"58b9cb8b520f720246cb3e5e6d5710a7bda9568102e931409ef216430e119d7db1d38f63af01670b5b753b9c9013cec201bd98c707bd345a8bc855b64ef7fb76","type":"Unknown","displayName":"Python 3.7.4 64-bit"}, Arg 2: undefined, Return Value: false
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Rule = system, result = runNextRule
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Executing next rule from system
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: autoSelectInterpreter, Class name = f, completed in 40ms, Arg 1: undefined, Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Interpreters returned by WorkspaceVirtualEnvService are of count 2
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Checking whether locactors have completed locating, Class name = p, completed in 0ms, , Return Value: true
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Hide locator refreshing progress, Class name = p, completed in 0ms, , Return Value: undefined
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: All locators have completed locating, Class name = p, completed in 1ms, , Return Value: undefined
2console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:19: Cached data exists getEnvironmentVariables, /Users/dalemy/Microsoft/pythontest 2/tests/test_subprocess.py
console.ts:134 [Extension Host] Warn Python Extension: 2019-08-02 14:35:19: Linter 'pylint' is not installed. Please install it or select another linter". [Error: Module 'pylint' not installed.	at p.execModule (/Users/dalemy/.vscode/extensions/ms-python.python-2019.6.24221/out/client/extension.js:75:289175)]
t.log @ console.ts:134
console.ts:134 [Extension Host] Info Python Extension: 2019-08-02 14:35:20: Current value for rule workspaceEnvs is nothing

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
karrtikrcommented, Aug 8, 2019

Closing this for now in favor of #5271 .

1reaction
dalemyerscommented, Aug 8, 2019

I found just now that “Code Helper” processes along with “jedi” Python processes (which mentioned the subprocess module) were stuck running (only found because Code would no longer launch). I killed all of these and restarted Code. The problem is no longer there.

It seems that it can get stuck in some weird state where these processes are stuck causing issues.

Here’s the output of ps aux | grep python:

dalemy           86113   0.0  0.0  5083172   2788   ??  S    Tue07am   0:00.14 /usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python lib/python/jedi/evaluate/compiled/subprocess/__main__.py lib/python
dalemy           86107   0.0  0.0  5353764   2808   ??  S    Tue07am   0:00.34 /usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python completion.py
dalemy           32969   0.0  0.0  6478628   2828   ??  S    Mon10am   0:53.16 /usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python lib/python/jedi/evaluate/compiled/subprocess/__main__.py lib/python
Read more comments on GitHub >

github_iconTop Results From Across the Web

subprocess — Subprocess management — Python 3.11.1 ...
Source code: Lib/subprocess.py The subprocess module allows you to spawn ... If shell is True , the specified command will be executed through...
Read more >
File not found error when launching a subprocess containing ...
I am using subprocess module for the same and using the check_output method as I need to capture the output for the same....
Read more >
Subprocess management — IronPython 2.7.2b1 documentation
When executable is given, the first item in the args sequence is still treated by most programs as the command name, which can...
Read more >
The subprocess Module: Wrapping Programs With Python
There are a few common reasons why you might want to call the shell with the Python subprocess module: When you know certain...
Read more >
GNU make
If the makefiles specify a double-colon rule to remake a file with a recipe but no prerequisites, that file will always be remade...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found