This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients nnorwitz, pitrou, rosslagerwall
Date 2011-03-20.16:47:58
SpamBayes Score 1.4566754e-05
Marked as misclassified No
Message-id <1300639681.51.0.654119922856.issue11616@psf.upfronthosting.co.za>
In-reply-to
Content
Using WNOHANG means that still-running children won't get collected. This seems to defeat the point of reap_children(). This patch seems to work:


diff -r adbdb3e74461 Lib/test/support.py
--- a/Lib/test/support.py       Sun Mar 20 17:36:26 2011 +0100
+++ b/Lib/test/support.py       Sun Mar 20 17:45:35 2011 +0100
@@ -1294,10 +1294,9 @@ def reap_children():
         while True:
             try:
                 # This will raise an exception on Windows.  That's ok.
-                pid, status = os.waitpid(any_process, os.WNOHANG)
-                if pid == 0:
-                    break
-            except:
+                pid, status = os.waitpid(any_process, 0)
+            except OSError:
+                # Either we're on Windows, or no running child remains.
                 break
 
 @contextlib.contextmanager
History
Date User Action Args
2011-03-20 16:48:01pitrousetrecipients: + pitrou, nnorwitz, rosslagerwall
2011-03-20 16:48:01pitrousetmessageid: <1300639681.51.0.654119922856.issue11616@psf.upfronthosting.co.za>
2011-03-20 16:47:58pitroulinkissue11616 messages
2011-03-20 16:47:58pitroucreate