osmith submitted this change.
obs: lib.run_cmd: set stdin to subprocess.DEVNULL
Don't pass stdin to the programs, as we expect them to run
non-interactively and also don't show the program's output unless -v is
used or the exit code is not 0.
Change-Id: I7e893101c2a3e7b005659ec72aa44fa932b7ccd9
---
M scripts/obs/lib/__init__.py
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/obs/lib/__init__.py b/scripts/obs/lib/__init__.py
index 58fe0e4..1ed5ef5 100644
--- a/scripts/obs/lib/__init__.py
+++ b/scripts/obs/lib/__init__.py
@@ -119,9 +119,9 @@
print(f"+ {caller}(): {cmd}")
with tempfile.TemporaryFile(encoding="utf8", mode="w+") as output_buf:
- p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT, text=True, bufsize=1,
- *args, **kwargs)
+ p = subprocess.Popen(cmd, stdin=subprocess.DEVNULL,
+ stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
+ text=True, bufsize=1, *args, **kwargs)
while True:
out = p.stdout.read(1)
To view, visit change 29433. To unsubscribe, or for help writing mail filters, visit settings.