From 5539a30052e686c037ac5541c49e4738337c1026 Mon Sep 17 00:00:00 2001 From: Eleanor Boyd Date: Wed, 16 Aug 2023 09:35:25 -0700 Subject: [PATCH] fix data to string from buffer for output channel (#21821) fix https://github.com/microsoft/vscode-python/issues/21820 --- src/client/testing/testController/common/server.ts | 4 ++-- .../testing/testController/pytest/pytestDiscoveryAdapter.ts | 4 ++-- .../testing/testController/pytest/pytestExecutionAdapter.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client/testing/testController/common/server.ts b/src/client/testing/testController/common/server.ts index 661290bf49885..8797a861fb4aa 100644 --- a/src/client/testing/testController/common/server.ts +++ b/src/client/testing/testController/common/server.ts @@ -213,10 +213,10 @@ export class PythonTestServer implements ITestServer, Disposable { // Take all output from the subprocess and add it to the test output channel. This will be the pytest output. // Displays output to user and ensure the subprocess doesn't run into buffer overflow. result?.proc?.stdout?.on('data', (data) => { - spawnOptions?.outputChannel?.append(data); + spawnOptions?.outputChannel?.append(data.toString()); }); result?.proc?.stderr?.on('data', (data) => { - spawnOptions?.outputChannel?.append(data); + spawnOptions?.outputChannel?.append(data.toString()); }); result?.proc?.on('exit', () => { traceLog('Exec server closed.', uuid); diff --git a/src/client/testing/testController/pytest/pytestDiscoveryAdapter.ts b/src/client/testing/testController/pytest/pytestDiscoveryAdapter.ts index 44ab3746dde49..450e2ef1edf2e 100644 --- a/src/client/testing/testController/pytest/pytestDiscoveryAdapter.ts +++ b/src/client/testing/testController/pytest/pytestDiscoveryAdapter.ts @@ -89,10 +89,10 @@ export class PytestTestDiscoveryAdapter implements ITestDiscoveryAdapter { // Take all output from the subprocess and add it to the test output channel. This will be the pytest output. // Displays output to user and ensure the subprocess doesn't run into buffer overflow. result?.proc?.stdout?.on('data', (data) => { - spawnOptions.outputChannel?.append(data); + spawnOptions.outputChannel?.append(data.toString()); }); result?.proc?.stderr?.on('data', (data) => { - spawnOptions.outputChannel?.append(data); + spawnOptions.outputChannel?.append(data.toString()); }); result?.proc?.on('exit', () => { deferredExec.resolve({ stdout: '', stderr: '' }); diff --git a/src/client/testing/testController/pytest/pytestExecutionAdapter.ts b/src/client/testing/testController/pytest/pytestExecutionAdapter.ts index 4a9a57b16fede..96d53db22c1c3 100644 --- a/src/client/testing/testController/pytest/pytestExecutionAdapter.ts +++ b/src/client/testing/testController/pytest/pytestExecutionAdapter.ts @@ -169,10 +169,10 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter { // Take all output from the subprocess and add it to the test output channel. This will be the pytest output. // Displays output to user and ensure the subprocess doesn't run into buffer overflow. result?.proc?.stdout?.on('data', (data) => { - this.outputChannel?.append(data); + this.outputChannel?.append(data.toString()); }); result?.proc?.stderr?.on('data', (data) => { - this.outputChannel?.append(data); + this.outputChannel?.append(data.toString()); }); result?.proc?.on('exit', () => {