Skip to content

Commit

Permalink
[gen] subprocess.run result pipes are not files
Browse files Browse the repository at this point in the history
`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
  • Loading branch information
ldrumm committed Jan 22, 2024
1 parent b05c5b5 commit 9c6f84e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/generate_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")

"""
Expand All @@ -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.")

"""
Expand Down

0 comments on commit 9c6f84e

Please sign in to comment.