Skip to content

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

Closed

Description

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)]"}}

Activity

  1. karrtikr commented on Dec 13, 2022

    @karrtikr

    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?

  2. DonJayamanne commented on Jan 3, 2023

    @DonJayamanne
    Author

    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

  3. karrtikr commented on Jan 4, 2023

    @karrtikr

    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.

  4. karrtikr commented on Jan 4, 2023

    @karrtikr

    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://github.com/microsoft/vscode-jupyter/blob/7ee68bf5fc2ca0ea4b8960aab5a927ce9ee9e3eb/src/platform/api/pythonApi.ts#L697

  5. DonJayamanne commented on Jan 4, 2023

    @DonJayamanne
    Author

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

  6. locked as resolved and limited conversation to collaborators on Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from postertriage-neededNeeds assignment to the proper sub-team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions