Skip to content

Isolate script removes wrong entry from sys.path for embedded Python on Windows #13942

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
karthiknadig opened this issue Sep 16, 2020 · 2 comments
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority

Comments

@karthiknadig
Copy link
Member

karthiknadig commented Sep 16, 2020

In some cases sys.path looks like this:

[
'C:\\opt\\ros\\noetic\\x64\\python38.zip',  // we remove this entry
'C:\\opt\\ros\\noetic\\x64', 
'C:\\Users\\Karthik Nadig\\AppData\\Roaming\\Python\\Python38\\site-packages', 
'C:\\opt\\ros\\noetic\\x64\\lib\\site-packages', 
'', 
'C:\\Users\\Karthik Nadig\\.vscode\\extensions\\ms-python.python-2020.8.109390\\pythonFiles',
'C:\\opt\\ros\\noetic\\x64\\lib\\site-packages\\win32', 
'C:\\opt\\ros\\noetic\\x64\\lib\\site-packages\\win32\\lib', 
'C:\\opt\\ros\\noetic\\x64\\lib\\site-packages\\Pythonwin'
]

After isolation it looks like this:

[
'c:\\Users\\Karthik Nadig\\.vscode\\extensions\\ms-python.python-2020.8.109390\\pythonFiles\\.does-not-exist',
'C:\\opt\\ros\\noetic\\x64', 
'C:\\Users\\Karthik Nadig\\AppData\\Roaming\\Python\\Python38\\site-packages', 
'C:\\opt\\ros\\noetic\\x64\\lib\\site-packages', 
'', 
'C:\\Users\\Karthik Nadig\\.vscode\\extensions\\ms-python.python-2020.8.109390\\pythonFiles', 
'C:\\opt\\ros\\noetic\\x64\\lib\\site-packages\\win32', 
'C:\\opt\\ros\\noetic\\x64\\lib\\site-packages\\win32\\lib', 
'C:\\opt\\ros\\noetic\\x64\\lib\\site-packages\\Pythonwin'
]

When really it should be:

[
'c:\\Users\\Karthik Nadig\\.vscode\\extensions\\ms-python.python-2020.8.109390\\pythonFiles\\.does-not-exist',
'C:\\opt\\ros\\noetic\\x64\\python38.zip',
'C:\\opt\\ros\\noetic\\x64', 
'C:\\Users\\Karthik Nadig\\AppData\\Roaming\\Python\\Python38\\site-packages', 
'C:\\opt\\ros\\noetic\\x64\\lib\\site-packages', 
'', 
'C:\\opt\\ros\\noetic\\x64\\lib\\site-packages\\win32', 
'C:\\opt\\ros\\noetic\\x64\\lib\\site-packages\\win32\\lib', 
'C:\\opt\\ros\\noetic\\x64\\lib\\site-packages\\Pythonwin'
]
@karthiknadig karthiknadig added bug Issue identified by VS Code Team member as probable bug triage-needed Needs assignment to the proper sub-team needs PR important Issue identified as high-priority and removed triage-needed Needs assignment to the proper sub-team labels Sep 16, 2020
@karthiknadig
Copy link
Member Author

karthiknadig commented Sep 16, 2020

remove both these entries while isolating:

'', 

Also look for and remove the workspace path (which should be cwd).

@luabud luabud changed the title Isolate script removes wrong entry from sys.path Isolate script removes wrong entry from sys.path for embedded Python on Windows Sep 16, 2020
@luabud luabud closed this as completed Sep 23, 2020
@ghost ghost removed the needs PR label Sep 23, 2020
@karthiknadig
Copy link
Member Author

Related #11434

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority
Projects
None yet
Development

No branches or pull requests

2 participants