From 324319db5e09cc4fb19f8e3b8d4a7c6098225556 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 1 Nov 2023 15:49:01 -0400 Subject: [PATCH] fix: reduce unclosed IO warnings Signed-off-by: Henry Schreiner --- plumbum/commands/base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plumbum/commands/base.py b/plumbum/commands/base.py index 8511ec33..716c87ba 100644 --- a/plumbum/commands/base.py +++ b/plumbum/commands/base.py @@ -400,6 +400,8 @@ def popen(self, args=(), **kwargs): dstproc = self.dstcmd.popen(**kwargs) # allow p1 to receive a SIGPIPE if p2 exits srcproc.stdout.close() + if srcproc.stderr: + srcproc.stderr.close() if srcproc.stdin and src_kwargs.get("stdin") != PIPE: srcproc.stdin.close() dstproc.srcproc = srcproc