--- py3k-subprocess2-unittest/Lib/subprocess.py 2010-12-11 02:31:37.000000000 +0200 +++ py3k-subprocess2-unittest2/Lib/subprocess.py 2010-12-11 15:50:37.000000000 +0200 @@ -1092,7 +1092,7 @@ # precondition: fds_to_keep must be sorted and unique start_fd = 3 for fd in fds_to_keep: - if fd > start_fd: + if fd >= start_fd: os.closerange(start_fd, fd) start_fd = fd + 1 if start_fd <= MAXFD: --- py3k-subprocess2-unittest/Modules/_posixsubprocess.c 2010-12-11 03:03:17.000000000 +0200 +++ py3k-subprocess2-unittest2/Modules/_posixsubprocess.c 2010-12-11 15:54:08.000000000 +0200 @@ -107,7 +107,7 @@ errno = 0; /* We don't want to report an OSError. */ goto error; } - if (keep_fd <= start_fd) + if (keep_fd < start_fd) continue; for (fd_num = start_fd; fd_num < keep_fd; ++fd_num) { close(fd_num);