diff --git a/src/client/pythonEnvironments/base/locators/lowLevel/filesLocator.ts b/src/client/pythonEnvironments/base/locators/lowLevel/filesLocator.ts index 0a6fa28d84fd..27687feb3ad3 100644 --- a/src/client/pythonEnvironments/base/locators/lowLevel/filesLocator.ts +++ b/src/client/pythonEnvironments/base/locators/lowLevel/filesLocator.ts @@ -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'; @@ -58,7 +58,7 @@ async function* iterMinimalEnvsFromExecutables( kind: PythonEnvKind, ): AsyncIterableIterator { for await (const filename of executables) { - const executable = normalizePath(filename); + const executable = resolvePath(filename); yield getFastEnvInfo(kind, executable); } } diff --git a/src/client/pythonEnvironments/common/externalDependencies.ts b/src/client/pythonEnvironments/common/externalDependencies.ts index 059a0bdd387f..aec78ad1d21b 100644 --- a/src/client/pythonEnvironments/common/externalDependencies.ts +++ b/src/client/pythonEnvironments/common/externalDependencies.ts @@ -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); } diff --git a/src/test/pythonEnvironments/base/locators/lowLevel/windowsKnownPathsLocator.functional.test.ts b/src/test/pythonEnvironments/base/locators/lowLevel/windowsKnownPathsLocator.functional.test.ts index 3cc3502b12a1..b57744e74e39 100644 --- a/src/test/pythonEnvironments/base/locators/lowLevel/windowsKnownPathsLocator.functional.test.ts +++ b/src/test/pythonEnvironments/base/locators/lowLevel/windowsKnownPathsLocator.functional.test.ts @@ -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; }