[Win] Pass close_fds = True in Python popen call.
authorpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Mar 2017 21:10:54 +0000 (21:10 +0000)
committerpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Mar 2017 21:10:54 +0000 (21:10 +0000)
https://bugs.webkit.org/show_bug.cgi?id=170172

Reviewed by Brent Fulgham.

This was previously not supported on Windows, but in Python 2.7.10 it is.

* Scripts/webkitpy/common/system/executive.py:
(Executive._should_close_fds):
* Scripts/webkitpy/port/server_process.py:
(ServerProcess._start):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214622 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/common/system/executive.py
Tools/Scripts/webkitpy/port/server_process.py

index 7cac232..62350a3 100644 (file)
@@ -1,3 +1,17 @@
+2017-03-30  Per Arne Vollan  <pvollan@apple.com>
+
+        [Win] Pass close_fds = True in Python popen call.
+        https://bugs.webkit.org/show_bug.cgi?id=170172
+
+        Reviewed by Brent Fulgham.
+
+        This was previously not supported on Windows, but in Python 2.7.10 it is.
+
+        * Scripts/webkitpy/common/system/executive.py:
+        (Executive._should_close_fds):
+        * Scripts/webkitpy/port/server_process.py:
+        (ServerProcess._start):
+
 2017-03-30  Aakash Jain  <aakash_jain@apple.com>
 
         Change my status to be a WebKit reviewer.
index 82cf2d7..26a2b7a 100644 (file)
@@ -91,9 +91,8 @@ class Executive(object):
         # We need to pass close_fds=True to work around Python bug #2320
         # (otherwise we can hang when we kill DumpRenderTree when we are running
         # multiple threads). See http://bugs.python.org/issue2320 .
-        # Note that close_fds isn't supported on Windows, but this bug only
-        # shows up on Mac and Linux.
-        return not (sys.platform == 'cygwin' or sys.platform.startswith('win'))
+        # In Python 2.7.10, close_fds is also supported on Windows.
+        return True
 
     def _run_command_with_teed_output(self, args, teed_output, **kwargs):
         child_process = self.popen(args,
index 3e8c487..3d0bf00 100644 (file)
@@ -114,7 +114,8 @@ class ServerProcess(object):
             raise ValueError("%s already running" % self._name)
         self._reset()
         # close_fds is a workaround for http://bugs.python.org/issue2320
-        close_fds = not self._host.platform.is_win()
+        # In Python 2.7.10, close_fds is also supported on Windows.
+        close_fds = True
         self._proc = self._host.executive.popen(self._cmd, stdin=self._host.executive.PIPE,
             stdout=self._host.executive.PIPE,
             stderr=self._host.executive.PIPE,