Changeset 58434 in webkit
- Timestamp:
- Apr 28, 2010 2:51:34 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 14 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r58411 r58434 1 2010-04-28 Eric Seidel <eric@webkit.org> 2 3 Reviewed by David Levin. 4 5 Audit all uses of subprocess in webkitpy 6 https://bugs.webkit.org/show_bug.cgi?id=38284 7 8 After further discussions with Jeffrey Yasskin 9 about http://bugs.python.org/issue2320 10 and related issues of using subprocess from 11 multiple threads, I have learned that subprocess 12 is known to be non-threadsafe through recent 13 Python 2.7 builds. 14 15 I'm attempting to lessen our exposure to these 16 subprocess bugs by auditing each use of subprocess 17 in webkitpy. I did not find any unsafe calls 18 in my audit, but I did remove numerous unneeded 19 import subprocess lines. 20 21 * Scripts/webkitpy/common/checkout/api.py: 22 * Scripts/webkitpy/common/net/bugzilla.py: 23 * Scripts/webkitpy/common/system/deprecated_logging_unittest.py: 24 * Scripts/webkitpy/common/system/user.py: 25 * Scripts/webkitpy/layout_tests/port/base.py: 26 * Scripts/webkitpy/layout_tests/port/chromium_linux.py: 27 * Scripts/webkitpy/layout_tests/port/chromium_mac.py: 28 * Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py: Added. 29 * Scripts/webkitpy/layout_tests/port/chromium_win.py: 30 * Scripts/webkitpy/layout_tests/port/gtk.py: 31 * Scripts/webkitpy/layout_tests/port/mac.py: 32 * Scripts/webkitpy/layout_tests/port/qt.py: 33 * Scripts/webkitpy/layout_tests/port/webkit.py: 34 * Scripts/webkitpy/layout_tests/port/win.py: 35 1 36 2010-04-28 Darin Adler <darin@apple.com> 2 37 -
trunk/WebKitTools/Scripts/webkitpy/common/checkout/api.py
r58261 r58434 28 28 29 29 import os 30 import subprocess31 30 import StringIO 32 31 -
trunk/WebKitTools/Scripts/webkitpy/common/net/bugzilla.py
r58210 r58434 34 34 import re 35 35 import StringIO 36 import subprocess37 36 38 37 from datetime import datetime # used in timestamp() -
trunk/WebKitTools/Scripts/webkitpy/common/system/deprecated_logging_unittest.py
r56699 r58434 28 28 29 29 import os 30 import subprocess31 30 import StringIO 32 31 import tempfile -
trunk/WebKitTools/Scripts/webkitpy/common/system/user.py
r58314 r58434 63 63 editor = os.environ.get("EDITOR") or "vi" 64 64 args = shlex.split(editor) 65 # Note: Not thread safe: http://bugs.python.org/issue2320 65 66 subprocess.call(args + files) 66 67 -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
r58395 r58434 36 36 import os 37 37 import shlex 38 import subprocess39 38 import sys 40 39 import time … … 149 148 result = True 150 149 try: 151 if s ubprocess.call(cmd) == 0:150 if self._executive.run_command(cmd, return_exit_code=True) == 0: 152 151 return False 153 152 except OSError, e: … … 156 155 else: 157 156 raise e 158 except ValueError:159 # work around a race condition in Python 2.4's implementation160 # of subprocess.Popen. See http://bugs.python.org/issue1199282 .161 pass162 157 return result 163 158 -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py
r58397 r58434 32 32 import logging 33 33 import os 34 import platform35 34 import signal 36 import subprocess37 35 38 36 import chromium … … 123 121 'wdiff"') 124 122 _log.error('') 123 # FIXME: The ChromiumMac port always returns True. 125 124 return result 126 125 -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
r58397 r58434 34 34 import platform 35 35 import signal 36 import subprocess37 36 38 37 import chromium 38 39 from webkitpy.common.system.executive import Executive 39 40 40 41 _log = logging.getLogger("webkitpy.layout_tests.port.chromium_mac") … … 100 101 101 102 def _check_wdiff_install(self): 102 # FIXME: This should use Executive.103 f = open(os.devnull, 'w')104 rcode = 0105 103 try: 106 rcode = subprocess.call(['wdiff'], stderr=f) 104 # We're ignoring the return and always returning True 105 self._executive.run_command([self._path_to_wdiff()], error_handler=Executive.ignore_error) 107 106 except OSError: 108 107 _log.warning('wdiff not found. Install using MacPorts or some ' 109 108 'other means') 110 pass111 f.close()112 109 return True 113 110 -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py
r58427 r58434 1 # Copyright (C) 20 09Google Inc. All rights reserved.1 # Copyright (C) 2010 Google Inc. All rights reserved. 2 2 # 3 3 # Redistribution and use in source and binary forms, with or without … … 27 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 29 import os 30 import subprocess 31 import StringIO 32 import tempfile 29 import chromium_mac 33 30 import unittest 34 31 35 from webkitpy.common.system.executive import ScriptError 36 from webkitpy.common.system.deprecated_logging import * 37 38 class LoggingTest(unittest.TestCase): 39 40 def assert_log_equals(self, log_input, expected_output): 41 original_stderr = sys.stderr 42 test_stderr = StringIO.StringIO() 43 sys.stderr = test_stderr 44 45 try: 46 log(log_input) 47 actual_output = test_stderr.getvalue() 48 finally: 49 sys.stderr = original_stderr 50 51 self.assertEquals(actual_output, expected_output, "log(\"%s\") expected: %s actual: %s" % (log_input, expected_output, actual_output)) 52 53 def test_log(self): 54 self.assert_log_equals("test", "test\n") 55 56 # Test that log() does not throw an exception when passed an object instead of a string. 57 self.assert_log_equals(ScriptError(message="ScriptError"), "ScriptError\n") 32 from webkitpy.thirdparty.mock import Mock 58 33 59 34 60 if __name__ == '__main__': 61 unittest.main() 35 class ChromiumMacPortTest(unittest.TestCase): 36 37 def test_check_wdiff_install(self): 38 port = chromium_mac.ChromiumMacPort() 39 # Currently is always true, just logs if missing. 40 self.assertTrue(port._check_wdiff_install()) -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
r58397 r58434 32 32 import logging 33 33 import os 34 import platform35 import signal36 import subprocess37 34 import sys 38 35 -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/gtk.py
r58397 r58434 31 31 import logging 32 32 import os 33 import subprocess34 33 35 34 from webkitpy.layout_tests.port.webkit import WebKitPort -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py
r58397 r58434 31 31 import logging 32 32 import os 33 import pdb34 33 import platform 35 import re36 import shutil37 34 import signal 38 import subprocess39 import sys40 import time41 import webbrowser42 35 43 36 import webkitpy.common.system.ospath as ospath -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/qt.py
r58397 r58434 31 31 import logging 32 32 import os 33 import subprocess34 33 import signal 35 34 -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit.py
r58314 r58434 36 36 import logging 37 37 import os 38 import pdb39 import platform40 38 import re 41 39 import shutil 42 40 import signal 43 import subprocess44 41 import sys 45 42 import time … … 389 386 command += "\n" 390 387 391 # pdb.set_trace()392 388 self._server_process.write(command) 393 389 -
trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/win.py
r58397 r58434 31 31 import logging 32 32 import os 33 import subprocess34 33 35 34 from webkitpy.layout_tests.port.webkit import WebKitPort
Note: See TracChangeset
for help on using the changeset viewer.