Changeset 224795 in webkit


Ignore:
Timestamp:
Nov 13, 2017, 4:55:41 PM (8 years ago)
Author:
commit-queue@webkit.org
Message:

[Windows] Fix Python error for subprocess.popen with close_fds
https://bugs.webkit.org/show_bug.cgi?id=179553

Patch by Basuke Suzuki <Basuke Suzuki> on 2017-11-13
Reviewed by Per Arne Vollan.

  • Scripts/webkitpy/port/server_process.py:

(ServerProcess._start):
(ServerProcess._should_close_fds):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r224793 r224795  
     12017-11-13  Basuke Suzuki  <Basuke.Suzuki@sony.com>
     2
     3        [Windows] Fix Python error for subprocess.popen with close_fds
     4        https://bugs.webkit.org/show_bug.cgi?id=179553
     5
     6        Reviewed by Per Arne Vollan.
     7
     8        * Scripts/webkitpy/port/server_process.py:
     9        (ServerProcess._start):
     10        (ServerProcess._should_close_fds):
     11
    1122017-11-13  Michael Catanzaro  <mcatanzaro@igalia.com>
    213
  • trunk/Tools/Scripts/webkitpy/port/server_process.py

    r224695 r224795  
    111111            raise ValueError("%s already running" % self._name)
    112112        self._reset()
    113         # close_fds is a workaround for http://bugs.python.org/issue2320
    114         # In Python 2.7.10, close_fds is also supported on Windows.
    115         close_fds = True
    116113        self._proc = self._target_host.executive.popen(self._cmd, stdin=self._target_host.executive.PIPE,
    117114            stdout=self._target_host.executive.PIPE,
    118115            stderr=self._target_host.executive.PIPE,
    119             close_fds=close_fds,
     116            close_fds=self._should_close_fds(),
    120117            env=self._env,
    121118            universal_newlines=self._universal_newlines)
     
    124121            self._set_file_nonblocking(self._proc.stdout)
    125122            self._set_file_nonblocking(self._proc.stderr)
     123
     124    def _should_close_fds(self):
     125        # We need to pass close_fds=True to work around Python bug #2320
     126        # (otherwise we can hang when we kill DumpRenderTree when we are running
     127        # multiple threads). See http://bugs.python.org/issue2320 .
     128        # In Python 2.7.10, close_fds is also supported on Windows.
     129        # However, "you cannot set close_fds to true and also redirect the standard
     130        # handles by setting stdin, stdout or stderr.".
     131        platform = self._port.host.platform
     132        if platform.is_win() and not platform.is_cygwin():
     133            return False
     134        else:
     135            return True
    126136
    127137    def _handle_possible_interrupt(self):
Note: See TracChangeset for help on using the changeset viewer.