Skip to content

Fix issue with sys.prefix when getting environment details. #16386

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

Merged
merged 3 commits into from
Jun 5, 2021

Conversation

karthiknadig
Copy link
Member

Closes #16355

@karthiknadig karthiknadig marked this pull request as ready for review June 4, 2021 17:41
@karthiknadig karthiknadig requested a review from karrtikr June 4, 2021 18:17
Copy link

@karrtikr karrtikr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as a temp fix.

@karthiknadig karthiknadig merged commit 547243f into microsoft:main Jun 5, 2021
@karthiknadig karthiknadig deleted the sysprefix branch June 8, 2021 15:40
Comment on lines +207 to +213
const env = (await this.api.resolveEnv(envInfo)) ?? envInfo;
if (env.executable.sysPrefix) {
const execInfoService = getEnvironmentInfoService();
const info = await execInfoService.getEnvironmentInfo(pythonPath, EnvironmentInfoServiceQueuePriority.High);
if (info) {
env.executable.sysPrefix = info.executable.sysPrefix;
env.version = info.version;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karthiknadig I don't think #16355 (comment) holds true anymore as we do not return from cache if it does not have complete info:

public getCompleteInfo(path: string): PythonEnvInfo | undefined {
// `path` can either be path to environment or executable path
let env = this.envs.find((e) => arePathsSame(e.location, path));
if (env?.hasCompleteInfo) {
return env;
}
env = this.envs.find((e) => areSameEnv(e, path));
return env?.hasCompleteInfo ? env : undefined;
}

So I'm going to remove this, please correct me if I'm wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GetInterpreterDetails no longer returning sys.prefix
3 participants