From f791d7a278fed1ff3b12bce5c984e4dc907bca62 Mon Sep 17 00:00:00 2001 From: Peter Astrand Date: Sat, 1 Jan 2005 09:38:57 +0000 Subject: [PATCH] On UNIX, when the execution of the child fails, we must waitpid() to prevent leaving zombies. --- Lib/subprocess.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/subprocess.py b/Lib/subprocess.py index da0c31b6c93..5d0c5e668e3 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -1023,6 +1023,7 @@ class Popen(object): data = os.read(errpipe_read, 1048576) # Exceptions limited to 1 MB os.close(errpipe_read) if data != "": + os.waitpid(self.pid, 0) child_exception = pickle.loads(data) raise child_exception