2011-02-04 Tony Chang <tony@chromium.org>
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Feb 2011 02:39:01 +0000 (02:39 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Feb 2011 02:39:01 +0000 (02:39 +0000)
        Reviewed by Eric Seidel.

        get test-webkitpy running on win32 python
        https://bugs.webkit.org/show_bug.cgi?id=53822

        The test harness crashes with a WindowsError because it can't find
        'svn' when using subprocess.Popen.  This gets us past the error
        so we can see the failing tests on the Chromium Win Release Tests
        bot.

        * Scripts/webkitpy/common/system/executive.py:

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

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

index 3327a2a77da4409c8a96e4af107dbea008f06483..d06344984b6e5acdd785c1685b6be80705309386 100644 (file)
@@ -1,3 +1,17 @@
+2011-02-04  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        get test-webkitpy running on win32 python
+        https://bugs.webkit.org/show_bug.cgi?id=53822
+
+        The test harness crashes with a WindowsError because it can't find
+        'svn' when using subprocess.Popen.  This gets us past the error
+        so we can see the failing tests on the Chromium Win Release Tests
+        bot.
+
+        * Scripts/webkitpy/common/system/executive.py:
+
 2011-02-04  Martin Robinson  <mrobinson@igalia.com>
 
         Reviewed by Gustavo Noronha Silva.
index 02619db4d5d7b41bd7744c46ea94953659dee2b3..9155350e806bcae25909bcec79a590afe0b17fdd 100644 (file)
@@ -111,6 +111,11 @@ class Executive(object):
         # shows up on Mac and Linux.
         return sys.platform not in ('win32', 'cygwin')
 
+    def _should_use_shell(self):
+        # On Windows, if we don't use the shell, we don't search %PATH% to
+        # find the command-- an absolute path is required.
+        return sys.platform.startswith('win')
+
     def _run_command_with_teed_output(self, args, teed_output):
         args = map(unicode, args)  # Popen will throw an exception if args are non-strings (like int())
         args = map(self._encode_argument_if_needed, args)
@@ -118,7 +123,8 @@ class Executive(object):
         child_process = subprocess.Popen(args,
                                          stdout=subprocess.PIPE,
                                          stderr=subprocess.STDOUT,
-                                         close_fds=self._should_close_fds())
+                                         close_fds=self._should_close_fds(),
+                                         shell=self._should_use_shell())
 
         # Use our own custom wait loop because Popen ignores a tee'd
         # stderr/stdout.
@@ -351,7 +357,8 @@ class Executive(object):
                                    stdout=subprocess.PIPE,
                                    stderr=stderr,
                                    cwd=cwd,
-                                   close_fds=self._should_close_fds())
+                                   close_fds=self._should_close_fds(),
+                                   shell=self._should_use_shell())
         output = process.communicate(string_to_communicate)[0]
 
         # run_command automatically decodes to unicode() unless explicitly told not to.