From c1e5d8abaf03520582ccc44c8afebcf6c7979cf2 Mon Sep 17 00:00:00 2001 From: ficapy Date: Sun, 14 May 2023 22:56:09 +0800 Subject: [PATCH] fixup pipBulkShow function to prevent breaking with numerous names --- packages/pyright-scip/src/virtualenv/environment.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/pyright-scip/src/virtualenv/environment.ts b/packages/pyright-scip/src/virtualenv/environment.ts index 691f5ed48..9ae3a9878 100644 --- a/packages/pyright-scip/src/virtualenv/environment.ts +++ b/packages/pyright-scip/src/virtualenv/environment.ts @@ -33,10 +33,10 @@ function pipList(): PipInformation[] { } function pipBulkShow(names: string[]): string[] { - // TODO: This probably breaks with enough names. Should batch them into 512 or whatever the max for bash would be + const maxBuffer = 1024 * 1024 * 10; // 10MB return child_process - .execSync(`${getPipCommand()} show -f ${names.join(' ')}`) - .toString() + .spawnSync(getPipCommand(), ['show', '-f', `${names.join(' ')}`], {maxBuffer}) + .stdout.toString() .split('---'); }