You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Request to active interpreter returns Uris with different casings for the same environment #20300
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.
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)]"}}
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:
Activity
karrtikr commentedon Dec 13, 2022
Wasn't able to reproduce this on Windows, we only norm case "id":
Could it be that Jupyter is manipulating Uris again on their end?
DonJayamanne commentedon Jan 3, 2023
Kartik Raj (@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 commentedon Jan 4, 2023
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 commentedon Jan 4, 2023
Jupyter is still passing id to
resolveEnvironmentwhich 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:https://github.com/microsoft/vscode-jupyter/blob/7ee68bf5fc2ca0ea4b8960aab5a927ce9ee9e3eb/src/platform/api/pythonApi.ts#L697
DonJayamanne commentedon Jan 4, 2023
Kartik Raj (@karrtikr) thanks, lets close this issue then.
I'll fix the code at our end.