From: Karthikeyan Singaravelan Date: Tue, 24 Aug 2021 10:43:46 +0000 (+0530) Subject: bpo-43826: Fix resource warning due to unclosed objects. (GH-25381) X-Git-Tag: v3.11.0a1~348 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7179930ab5f5b2dea039023bec968aadc03e3775;p=thirdparty%2FPython%2Fcpython.git bpo-43826: Fix resource warning due to unclosed objects. (GH-25381) --- diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index f0f0e6f6069d..94a95c7a00bf 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -719,6 +719,8 @@ class ProcessTestCase(BaseTestCase): # However, this function is not yet in _winapi. p.stdin.write(b"pear") p.stdin.close() + p.stdout.close() + p.stderr.close() finally: p.kill() p.wait() @@ -746,6 +748,8 @@ class ProcessTestCase(BaseTestCase): # On other platforms we cannot test the pipe size (yet). But above # code using pipesize=-1 should not crash. p.stdin.close() + p.stdout.close() + p.stderr.close() finally: p.kill() p.wait() @@ -3243,6 +3247,7 @@ class POSIXProcessTestCase(BaseTestCase): with mock.patch.object(p, 'poll', new=lambda: None): p.returncode = None p.send_signal(signal.SIGTERM) + p.kill() def test_communicate_repeated_call_after_stdout_close(self): proc = subprocess.Popen([sys.executable, '-c',