Title: [273059] trunk/Tools
Revision
273059
Author
don.olmst...@sony.com
Date
2021-02-17 19:02:31 -0800 (Wed, 17 Feb 2021)

Log Message

[Python-3] Child process environment on Windows can only contain strings
https://bugs.webkit.org/show_bug.cgi?id=222012
<rdar://problem/74437205>

Unreviewed test runner fix.

Use old Python 2 behavior of encoding when running with that version.


* Scripts/webkitpy/common/system/executive.py:
(Executive.popen):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (273058 => 273059)


--- trunk/Tools/ChangeLog	2021-02-18 02:48:14 UTC (rev 273058)
+++ trunk/Tools/ChangeLog	2021-02-18 03:02:31 UTC (rev 273059)
@@ -1,5 +1,18 @@
 2021-02-17  Don Olmstead  <don.olmst...@sony.com>
 
+        [Python-3] Child process environment on Windows can only contain strings
+        https://bugs.webkit.org/show_bug.cgi?id=222012
+        <rdar://problem/74437205>
+
+        Unreviewed test runner fix.
+
+        Use old Python 2 behavior of encoding when running with that version.
+
+        * Scripts/webkitpy/common/system/executive.py:
+        (Executive.popen):
+
+2021-02-17  Don Olmstead  <don.olmst...@sony.com>
+
         _W3CTestConverter tests don't run on Windows
         https://bugs.webkit.org/show_bug.cgi?id=221855
 

Modified: trunk/Tools/Scripts/webkitpy/common/system/executive.py (273058 => 273059)


--- trunk/Tools/Scripts/webkitpy/common/system/executive.py	2021-02-18 02:48:14 UTC (rev 273058)
+++ trunk/Tools/Scripts/webkitpy/common/system/executive.py	2021-02-18 03:02:31 UTC (rev 273059)
@@ -512,12 +512,20 @@
         env = kwargs.pop('env', None)
         if self._is_native_win and env is not None:
             mod_env = {}
-            for key, value in env.items():
-                if not isinstance(key, str):
-                    key = key.decode('utf-8')
-                if not isinstance(value, str):
-                    value = value.decode('utf-8')
-                mod_env[key] = value
+            if sys.version_info.major >= 3:
+                for key, value in env.items():
+                    if not isinstance(key, str):
+                        key = key.decode('utf-8')
+                    if not isinstance(value, str):
+                        value = value.decode('utf-8')
+                    mod_env[key] = value
+            else:
+                for key, value in env.items():
+                    if not isinstance(key, bytes):
+                        key = key.encode('utf-8')
+                    if not isinstance(value, bytes):
+                        value = value.encode('utf-8')
+                    mod_env[key] = value
             env = mod_env
 
         # Python 3 treats Popen as a context manager, we should allow this in Python 2
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to