From 1003ca01bde393371414b6a28f55300794ffd75b Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 29 May 2023 17:14:24 +0200 Subject: [PATCH] read from buffers directly --- k8s_gitlab_borg/__main__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s_gitlab_borg/__main__.py b/k8s_gitlab_borg/__main__.py index 88b8dd8..858f878 100644 --- a/k8s_gitlab_borg/__main__.py +++ b/k8s_gitlab_borg/__main__.py @@ -510,7 +510,7 @@ def main(): if event & select.POLLIN or event & select.POLLPRI: if rfd == proc.stdout.fileno(): logger.debug("Reading from stdout...") - if chunk := proc.stdout.read(PIPE_BUF): + if chunk := proc.stdout.buffer.read(PIPE_BUF): logger.debug("Done, length %d", len(chunk)) stdout_line_buffer.extend(chunk) while True: @@ -524,7 +524,7 @@ def main(): break if rfd == proc.stderr.fileno(): logger.debug("Reading from stderr...") - if chunk := proc.stderr.read(PIPE_BUF): + if chunk := proc.stderr.buffer.read(PIPE_BUF): logger.debug("Done, length %d", len(chunk)) stderr_line_buffer.extend(chunk) while True: