Skip to content
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

Request to active interpreter returns Uris with different casings for the same environment #20300

Closed
DonJayamanne opened this issue Nov 30, 2022 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team

Comments

@DonJayamanne
Copy link

DonJayamanne commented Nov 30, 2022

When calling the API method to get the active interpreter we get the same environment, however sometimes the Uri (path to the executable is lower cased and sometimes its upper cased)

This causes issues in the Jupyter extension as the Uris are different values
Suggestion: Is it possible for Python to cache the Uri per Python Env Id, so that this never changes.

See here
All logs can be found here microsoft/vscode-jupyter#12207 (comment)

debug 09:31:08.170: Get Active Interpreter, Class name = x, completed in 56ms, has a truthy return value, Arg 1: "/c:/src/test/6", Return Value: {"id":"C:\\SRC\\TEST\\6\\.CONDA\\PYTHON.EXE","sysPrefix":"c:\\src\\test\\6\\.conda","envPath":{"$mid":1,"path":"/c:/src/test/6/.conda","scheme":"file"},"displayPath":{"$mid":1,"path":"/c:/src/test/6/.conda","scheme":"file"},"envName":"","uri":{"$mid":1,"fsPath":"c:\\src\\test\\6\\.conda\\python.exe","_sep":1,"path":"/c:/src/test/6/.conda/python.exe","scheme":"file"},"displayName":"","envType":"Conda","version":{"major":3,"minor":8,"patch":15,"raw":"3.8.15 (default, Nov 24 2022, 14:38:14) [MSC v.1916 64 bit (AMD64)]"}}


debug 09:30:57.943: Get Active Interpreter, Class name = x, completed in 39ms, has a truthy return value, Arg 1: undefined, Return Value: {"id":"C:\\SRC\\TEST\\6\\.CONDA\\PYTHON.EXE","sysPrefix":"c:\\src\\test\\6\\.conda","envPath":{"$mid":1,"path":"/c:/SRC/TEST/6/.CONDA","scheme":"file"},"displayPath":{"$mid":1,"path":"/c:/SRC/TEST/6/.CONDA","scheme":"file"},"envName":"","uri":{"$mid":1,"fsPath":"c:\\SRC\\TEST\\6\\.CONDA\\python.exe","_sep":1,"path":"/c:/SRC/TEST/6/.CONDA/python.exe","scheme":"file"},"displayName":"","envType":"Conda","version":{"major":3,"minor":8,"patch":15,"raw":"3.8.15 (default, Nov 24 2022, 14:38:14) [MSC v.1916 64 bit (AMD64)]"}}
@DonJayamanne DonJayamanne added the bug Issue identified by VS Code Team member as probable bug label Nov 30, 2022
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Nov 30, 2022
@karrtikr
Copy link

karrtikr commented Dec 13, 2022

Wasn't able to reproduce this on Windows, we only norm case "id":

image

Could it be that Jupyter is manipulating Uris again on their end?

@karrtikr karrtikr added the info-needed Issue requires more information from poster label Dec 13, 2022
@DonJayamanne
Copy link
Author

DonJayamanne commented Jan 3, 2023

@karrtikr not sure what more information you need from my end here.
I've transferred the issue here microsoft/vscode-jupyter#12487
You can see from the logs that the parts are in upper case

Are you can see in the logs some are upper case and some are lower case. See here microsoft/vscode-jupyter#12487

@karrtikr karrtikr removed the info-needed Issue requires more information from poster label Jan 3, 2023
@karrtikr
Copy link

karrtikr commented Jan 4, 2023

not sure what more information you need from my end here.

Just wanted to confirm it's the Python API which is returning this and not Jupyter, as I wasn't able to repro it.

@karrtikr
Copy link

karrtikr commented Jan 4, 2023

Jupyter is still passing id to resolveEnvironment which is the cause of this issue, I remember bringing this earlier as well that this scenario is not supported, looks like it isn't fixed:

image

https:/microsoft/vscode-jupyter/blob/7ee68bf5fc2ca0ea4b8960aab5a927ce9ee9e3eb/src/platform/api/pythonApi.ts#L697

@karrtikr karrtikr added the info-needed Issue requires more information from poster label Jan 4, 2023
@DonJayamanne
Copy link
Author

@karrtikr thanks, lets close this issue then.
I'll fix the code at our end.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 4, 2023
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 info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants