From a26987a0a56d0eab5bab0e5d805d85aa7901a92c Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Sun, 1 Jun 2014 13:46:36 -0700 Subject: [PATCH 1/2] Fix the comment to not refer to the removed end_fd parameter. --- Modules/_posixsubprocess.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c index 8f5ce043624..f84cd26e8d9 100644 --- a/Modules/_posixsubprocess.c +++ b/Modules/_posixsubprocess.c @@ -234,8 +234,8 @@ struct linux_dirent64 { char d_name[256]; /* Filename (null-terminated) */ }; -/* Close all open file descriptors in the range start_fd inclusive to end_fd - * exclusive. Do not close any in the sorted py_fds_to_keep list. +/* Close all open file descriptors in the range from start_fd and higher + * Do not close any in the sorted py_fds_to_keep list. * * This version is async signal safe as it does not make any unsafe C library * calls, malloc calls or handle any locks. It is _unfortunate_ to be forced From ffd529cde138cb6ee211490dff13c6f6ee91e177 Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Sun, 1 Jun 2014 13:46:54 -0700 Subject: [PATCH 2/2] Explicitly wait for the child instead of letting a destructor do it. --- Lib/test/test_subprocess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index b1588e03bd5..8aa436e8f21 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -1966,7 +1966,7 @@ class POSIXProcessTestCase(BaseTestCase): import subprocess, sys subprocess.Popen([sys.executable, {fd_status!r}] + [str(x) for x in range({max_fd})], - close_fds=True) + close_fds=True).wait() """.format(fd_status=fd_status, max_fd=max_fd_open+1))], stdout=subprocess.PIPE, close_fds=False) finally: