Skip to content

The extension fails to load properly if reg.exe is blocked in windows. #11838

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
saaketp opened this issue May 15, 2020 · 3 comments
Closed

The extension fails to load properly if reg.exe is blocked in windows. #11838

saaketp opened this issue May 15, 2020 · 3 comments
Labels
area-environments Features relating to handling interpreter environments bug Issue identified by VS Code Team member as probable bug

Comments

@saaketp
Copy link

saaketp commented May 15, 2020

Environment data

  • VS Code version: 1.45.1
  • Extension version (available under the Extensions sidebar): 2020.5.78807
  • OS and version: Windows 7
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda Python 3.7
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Relevant/affected Python packages and their versions: Everything
  • Relevant/affected Python-related VS Code extensions and their versions:
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info How to update the language server to the latest stable version #3977): false
  • Value of the python.languageServer setting: Microsoft

Expected behaviour

I think registry access is just required for listing the installed python environments.
If access to reg.exe is denied, the extension should fall back to maybe just getting the python.exe from the PATH variable instead of failing to load completely.

Actual behaviour

The extension fails to load. If I try to use any feature like the data science UI, I get the error "spawn EPERM".

Steps to reproduce:

  1. Use vscode-python in windows where running reg.exe gives access denied.
  2. The extension cannot load and most of the commands give error "spawn EPERM"

Logs

This is happening in my work environment and I can't login to Github there. I can see in the console output that there is "spawn EPERM" error in getInterpretersFromRegistry.

Also, this wouldn't have been an issue if the winreg module in nodejs worked like winreg in python. Python uses the win32 api instead of spawning reg.exe subprocess, and that works even if reg.exe is blocked. So maybe switching from winreg to something else can also be considered?

@saaketp saaketp added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels May 15, 2020
@karthiknadig
Copy link
Member

We will look into this. This is easily reproducible.

@karthiknadig karthiknadig added area-environments Features relating to handling interpreter environments needs PR labels May 18, 2020
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label May 18, 2020
@joaompinto
Copy link

joaompinto commented Jul 15, 2020

This was a blocking issue for me in an environment where the execution of reg.exe is denied.
I am using the following work-around:

From a PowerShell prompt:

$extension_js = (Get-ChildItem -Path $Env:USERPROFILE\.vscode\extensions\ms-python.python*\out\client\extension.js).fullname

(Get-Content $extension_js) -replace 'reg.exe', 'reg_.exe' | Set-Content $extension_js

The extensions handles gracefully when the file is missing, but not when the access is denied :)

@kimadeline
Copy link

Closing since this was fixed as part of #12962.

@ghost ghost removed the needs PR label Sep 2, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-environments Features relating to handling interpreter environments bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

4 participants