New submission from Antoine Pitrou <pit...@free.fr>: 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 ---------- components: Tests messages: 131510 nosy: nnorwitz, pitrou, rosslagerwall priority: normal severity: normal stage: patch review status: open title: reap_children should not use WNOHANG type: behavior versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11616> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com