Change:
Type: <bBug</bI already filed this bug in the Pylance repository (microsoft/pylance-release), but it got closed because the Pylance devs think it's a problem with VSCode rather than with Pylance. Both files contain only Pylance + all its dependencies. the files , and . the VSCode profile from . This should work as expected. the Python file in VSCode and wait till Pylance is loaded (you might need to "trust" the window). the VSCode profile from . Here the error appears! The second VSCode profile should load and activate itself. The Pylance extension should be installed correctly and no error should appear. When the second VSCode profile is imported the following error notification appears: Unable to delete the existing folder 'c:Users<username.vscodeextensionsms-' while installing the extension 'ms-'. Please delete the folder manually and try again The profile is imported, but without Pylance. Additionally, Pylance is removed from the first profile as well! VS Code version: Code 1.77.3 (, 2023-04-12T09:16:02.548Z) OS version: WindowsNT x64 10.0. Modes: Sandboxed: No <details<summarySystem Info</summary </details<!-- generated by issue reporter --
I tried it and I cannot repro. May I know if you can reproduce this consistently?
I can still reproduce consistently on every try. I a minimal Python file to the repro.
I can repro while there are some exts depend on c#
I tried again with the same steps and provided profiles and I cannot repro. If you are able to repro consistently, can you please share following logs F1 Open View... Shared F1 Open View... Window
This issue has been closed automatically because it needs more information and has not had recent activity. See also our guidelines. Happy Coding!
Sorry, I was on vacation. Here are the logs: <details<summaryShared</summary</details<details<summaryWindow</summary</details
Same issue here. Basically makes Python unusable in more than one Profile.
reopen
<!-- AUTHORVERIFICATIONREQUEST --This bug has been fixed in the latest release of ! you can help us out by commenting if things are now working as expected. If things still don't seem right, please ensure you're on version of Insiders (today's or later - you can use in the command palette to check), and leave a comment letting us know what isn't working as expected. Happy Coding!
/verified

Discussion:
return null; } <del> async extractUserExtension(extensionKey: ExtensionKey, zipPath: string, metadata: Metadata, token: CancellationToken): Promise<ILocalExtension> { </del> <ins> async extractUserExtension(extensionKey: ExtensionKey, zipPath: string, metadata: Metadata, removeIfExists: boolean, token: CancellationToken): Promise<ILocalExtension> { </ins> await this.cleanUpGeneratedFoldersPromise.catch(() => undefined); const folderName = extensionKey.toString(); const tempPath = path.join(this.extensionsScannerService.userExtensionsLocation.fsPath, `.${generateUuid()}`); const extensionPath = path.join(this.extensionsScannerService.userExtensionsLocation.fsPath, folderName); <del> try { await pfs.Promises.rm(extensionPath); } catch (error) { throw new ExtensionManagementError(nls.localize('errorDeleting', "Unable to delete the existing folder '{0}' while installing the extension '{1}'. Please delete the folder manually and try again", extensionPath, extensionKey.id), ExtensionManagementErrorCode.Delete); </del> <ins> let exists = await this.fileService.exists(URI.file(extensionPath)); if (exists && removeIfExists) { try { await pfs.Promises.rm(extensionPath); } catch (error) { throw new ExtensionManagementError(nls.localize('errorDeleting', "Unable to delete the existing folder '{0}' while installing the extension '{1}'. Please delete the folder manually and try again", extensionPath, extensionKey.id), ExtensionManagementErrorCode.Delete); } exists = false; </ins> } <del> await this.extractAtLocation(extensionKey, zipPath, tempPath, token); await this.extensionsScannerService.updateMetadata(URI.file(tempPath), metadata); </del> <ins> if (!exists) { await this.extractAtLocation(extensionKey, zipPath, tempPath, token); await this.extensionsScannerService.updateMetadata(URI.file(tempPath), metadata); </ins> <del> try { this._onExtract.fire(URI.file(extensionPath)); await this.rename(extensionKey, tempPath, extensionPath, Date.now() + (2 * 60 * 1000) /* Retry for 2 minutes */); this.logService.info('Renamed to', extensionPath); } catch (error) { </del> try { <del> await pfs.Promises.rm(tempPath); } catch (e) { /* ignore */ } if (error.code === 'ENOTEMPTY') { this.logService.info(`Rename failed because extension was installed by another source. So ignoring renaming.`, extensionKey.id); } else { this.logService.info(`Rename failed because of ${getErrorMessage(error)}. Deleted from extracted location`, tempPath); throw error; </del> <ins> this._onExtract.fire(URI.file(extensionPath)); await this.rename(extensionKey, tempPath, extensionPath, Date.now() + (2 * 60 * 1000) /* Retry for 2 minutes */); this.logService.info('Renamed to', extensionPath); } catch (error) { try { await pfs.Promises.rm(tempPath); } catch (e) { /* ignore */ } if (error.code === 'ENOTEMPTY') { this.logService.info(`Rename failed because extension was installed by another source. So ignoring renaming.`, extensionKey.id); } else { this.logService.info(`Rename failed because of ${getErrorMessage(error)}. Deleted from extracted location`, tempPath); throw error; } </ins> } }

return local; } <del> protected async extractExtension({ zipPath, key, metadata }: InstallableExtension, token: CancellationToken): Promise<ILocalExtension> { </del> <ins> protected async extractExtension({ zipPath, key, metadata }: InstallableExtension, removeIfExists: boolean, token: CancellationToken): Promise<ILocalExtension> { </ins> let local = await this.unsetIfUninstalled(key); if (!local) { this.logService.trace('Extracting extension...', key.id); <del> local = await this.extensionsScanner.extractUserExtension(key, zipPath, metadata, token); </del> <ins> local = await this.extensionsScanner.extractUserExtension(key, zipPath, metadata, removeIfExists, token); </ins> this.logService.info('Extracting extension completed.', key.id); } return local;

try { this._verificationStatus = verificationStatus; this.validateManifest(location.fsPath); <del> const local = await this.extractExtension({ zipPath: location.fsPath, key: ExtensionKey.create(this.gallery), metadata }, token); </del> <ins> const local = await this.extractExtension({ zipPath: location.fsPath, key: ExtensionKey.create(this.gallery), metadata }, false, token); </ins> return [local, metadata]; } catch (error) { try {

} } <del> const local = await this.extractExtension({ zipPath: path.resolve(this.location.fsPath), key: extensionKey, metadata }, token); </del> <ins> const local = await this.extractExtension({ zipPath: path.resolve(this.location.fsPath), key: extensionKey, metadata }, true, token); </ins> return [local, metadata]; }