Skip to content

Do not lowercase executable paths returned by Windows path locator #15483

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 2 commits into from
Feb 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { Event, EventEmitter } from 'vscode';
import { iterPythonExecutablesInDir } from '../../../common/commonUtils';
import { normalizePath } from '../../../common/externalDependencies';
import { resolvePath } from '../../../common/externalDependencies';
import { PythonEnvInfo, PythonEnvKind } from '../../info';
import { getFastEnvInfo } from '../../info/env';
import { ILocator, IPythonEnvsIterator, PythonEnvUpdatedEvent, PythonLocatorQuery } from '../../locator';
Expand Down Expand Up @@ -58,7 +58,7 @@ async function* iterMinimalEnvsFromExecutables(
kind: PythonEnvKind,
): AsyncIterableIterator<PythonEnvInfo> {
for await (const filename of executables) {
const executable = normalizePath(filename);
const executable = resolvePath(filename);
yield getFastEnvInfo(kind, executable);
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/client/pythonEnvironments/common/externalDependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ export function normalizePath(filename: string): string {
return normalizeFilename(filename);
}

export function resolvePath(filename: string): string {
return path.resolve(filename);
}

export function normCasePath(filePath: string): string {
return getOSType() === OSType.Windows ? path.normalize(filePath).toUpperCase() : path.normalize(filePath);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ function getEnv(
): PythonEnvInfo {
const env = createNamedEnv(name, version, PythonEnvKind.Unknown, executable);
env.arch = Architecture.Unknown;
env.executable.filename = env.executable.filename.toLowerCase();
env.source = [PythonEnvSource.PathEnvVar];
return env;
}
Expand Down