[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

aroben at apple.com aroben at apple.com
Wed Dec 22 14:02:29 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit b57c51c61a6360ee560d4b6de090fe4bdfda061d
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 1 19:38:00 2010 +0000

    Encode Executive command arguments using UTF-8 on Cygwin
    
    Cygwin's Python's os.execv doesn't support unicode command arguments.
    Cygwin's execv expects arguments to be encoded using the current code
    page. But code pages are limited in what characters they can handle,
    and our tests include characters that the English code page can't
    handle.  So for now we'll just encode everything in UTF-8 on Cygwin,
    which can handle all characters but might confuse some commands, for
    expediency's sake. I'm sure we'll run into cases where UTF-8 isn't
    good enough, but we can deal with that when the problem arises.
    
    Reviewed by Adam Barth.
    
    Fixes <http://webkit.org/b/46892> <rdar://problem/8496639>
    webkitpy.common.system.executive_unittest.ExecutiveTest.test_run_command_with_unicode
    fails on Windows
    
    * Scripts/webkitpy/common/system/executive.py:
    (Executive._run_command_with_teed_output):
    (Executive.run_command):
    On Cygwin, encode arguments using UTF-8.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68913 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 62670dc..b457017 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,27 @@
+2010-10-01  Adam Roben  <aroben at apple.com>
+
+        Encode Executive command arguments using UTF-8 on Cygwin
+
+        Cygwin's Python's os.execv doesn't support unicode command arguments.
+        Cygwin's execv expects arguments to be encoded using the current code
+        page. But code pages are limited in what characters they can handle,
+        and our tests include characters that the English code page can't
+        handle.  So for now we'll just encode everything in UTF-8 on Cygwin,
+        which can handle all characters but might confuse some commands, for
+        expediency's sake. I'm sure we'll run into cases where UTF-8 isn't
+        good enough, but we can deal with that when the problem arises.
+
+        Reviewed by Adam Barth.
+
+        Fixes <http://webkit.org/b/46892> <rdar://problem/8496639>
+        webkitpy.common.system.executive_unittest.ExecutiveTest.test_run_command_with_unicode
+        fails on Windows
+
+        * Scripts/webkitpy/common/system/executive.py:
+        (Executive._run_command_with_teed_output):
+        (Executive.run_command):
+        On Cygwin, encode arguments using UTF-8.
+
 2010-10-01  Sam Weinig  <sam at webkit.org>
 
         Reviewed by Adam Roben.
diff --git a/WebKitTools/Scripts/webkitpy/common/system/executive.py b/WebKitTools/Scripts/webkitpy/common/system/executive.py
index 7c00f22..216cf58 100644
--- a/WebKitTools/Scripts/webkitpy/common/system/executive.py
+++ b/WebKitTools/Scripts/webkitpy/common/system/executive.py
@@ -103,6 +103,13 @@ class Executive(object):
 
     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())
+        if sys.platform == 'cygwin':
+            # Cygwin's Python's os.execv doesn't support unicode command
+            # arguments, and neither does Cygwin's execv itself.
+            # FIXME: Using UTF-8 here will confuse Windows-native commands
+            # which will expect arguments to be encoded using the current code
+            # page.
+            args = [arg.encode('utf-8') for arg in args]
         child_process = subprocess.Popen(args,
                                          stdout=subprocess.PIPE,
                                          stderr=subprocess.STDOUT,
@@ -281,6 +288,13 @@ class Executive(object):
         assert(isinstance(args, list) or isinstance(args, tuple))
         start_time = time.time()
         args = map(unicode, args)  # Popen will throw an exception if args are non-strings (like int())
+        if sys.platform == 'cygwin':
+            # Cygwin's Python's os.execv doesn't support unicode command
+            # arguments, and neither does Cygwin's execv itself.
+            # FIXME: Using UTF-8 here will confuse Windows-native commands
+            # which will expect arguments to be encoded using the current code
+            # page.
+            args = [arg.encode('utf-8') for arg in args]
         stdin, string_to_communicate = self._compute_stdin(input)
         stderr = subprocess.STDOUT if return_stderr else None
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list