Skip to content

Commit 9c6f84e

Browse files
committed
[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
1 parent b05c5b5 commit 9c6f84e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/generate_docs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def generate_html(dstpath):
262262
if result.returncode != 0:
263263
print("sphinx-build returned non-zero error code.")
264264
print("--- output ---")
265-
print(result.stderr.read().decode())
265+
print(result.stderr.decode())
266266
raise Exception("Failed to generate html documentation.")
267267

268268
"""
@@ -277,7 +277,7 @@ def generate_pdf(dstpath):
277277
if result.returncode != 0:
278278
print("sphinx-build returned non-zero error code.")
279279
print("--- output ---")
280-
print(result.stderr.read().decode())
280+
print(result.stderr.decode())
281281
raise Exception("Failed to generate pdf documentation.")
282282

283283
"""

0 commit comments

Comments
 (0)