diff --git a/src/client/common/process/pythonProcess.ts b/src/client/common/process/pythonProcess.ts index 9b9aa10d117a..0211434fb12a 100644 --- a/src/client/common/process/pythonProcess.ts +++ b/src/client/common/process/pythonProcess.ts @@ -34,6 +34,16 @@ export class PythonExecutionService implements IPythonExecutionService { ]); const json = JSON.parse(jsonValue) as { versionInfo: PythonVersionInfo; sysPrefix: string; sysVersion: string; is64Bit: boolean }; + const version_info = json.versionInfo; + // Exclude PII from `version_info` to ensure we don't send this up via telemetry. + for (let index = 0; index < 3; index += 1) { + if (typeof version_info[index] !== 'number') { + version_info[index] = 0; + } + } + if (['alpha', 'beta', 'candidate', 'final'].indexOf(version_info[3]) === -1) { + version_info[3] = 'unknown'; + } return { architecture: json.is64Bit ? Architecture.x64 : Architecture.x86, path: this.pythonPath, diff --git a/src/client/common/process/types.ts b/src/client/common/process/types.ts index 548398dc7701..987a019c2f5f 100644 --- a/src/client/common/process/types.ts +++ b/src/client/common/process/types.ts @@ -54,7 +54,7 @@ export type ExecutionFactoryCreationOptions = { export interface IPythonExecutionFactory { create(options: ExecutionFactoryCreationOptions): Promise; } -export type ReleaseLevel = 'alpha' | 'beta' | 'candidate' | 'final'; +export type ReleaseLevel = 'alpha' | 'beta' | 'candidate' | 'final' | 'unknown'; // tslint:disable-next-line:interface-name export type PythonVersionInfo = [number, number, number, ReleaseLevel]; export type InterpreterInfomation = {