From 9c6f84e651a4df9d98019787ba2fedca7f6584d5 Mon Sep 17 00:00:00 2001 From: Luke Drummond Date: Mon, 22 Jan 2024 17:49:03 +0000 Subject: [PATCH] [gen] subprocess.run result pipes are not files `subprocess.run` returns [CompletedProcess][1]. When used in conjunction with `subprocess.PIPE` for `stderr` or `stdout` it also has a corresponding string or bytes parameter. They are not file-like objects as in the case of `subprocess.Popen` which supports streaming pipes. [1] https://docs.python.org/3/library/subprocess.html#subprocess.CompletedProcess.stderr --- scripts/generate_docs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/generate_docs.py b/scripts/generate_docs.py index 3f28e1b75e..e25263d7d0 100644 --- a/scripts/generate_docs.py +++ b/scripts/generate_docs.py @@ -262,7 +262,7 @@ def generate_html(dstpath): if result.returncode != 0: print("sphinx-build returned non-zero error code.") print("--- output ---") - print(result.stderr.read().decode()) + print(result.stderr.decode()) raise Exception("Failed to generate html documentation.") """ @@ -277,7 +277,7 @@ def generate_pdf(dstpath): if result.returncode != 0: print("sphinx-build returned non-zero error code.") print("--- output ---") - print(result.stderr.read().decode()) + print(result.stderr.decode()) raise Exception("Failed to generate pdf documentation.") """