Title: [273913] trunk/Tools
Revision
273913
Author
aakash_j...@apple.com
Date
2021-03-04 12:42:52 -0800 (Thu, 04 Mar 2021)

Log Message

[ews] Add python 3 support - part 5
https://bugs.webkit.org/show_bug.cgi?id=222744

Reviewed by Jonathan Bedard.

* CISupport/ews-build/steps.py:
(CheckPatchRelevance._patch_is_relevant): Ensure that in python 3, path and changes are bytes. This is because buildbot
stores patch as bytes, as mentioned in https://github.com/buildbot/buildbot/issues/5812#issuecomment-790175979
* CISupport/ews-build/steps_unittest.py: Updated one unit-test to test binary patch.

Modified Paths

Diff

Modified: trunk/Tools/CISupport/ews-build/steps.py (273912 => 273913)


--- trunk/Tools/CISupport/ews-build/steps.py	2021-03-04 20:12:09 UTC (rev 273912)
+++ trunk/Tools/CISupport/ews-build/steps.py	2021-03-04 20:42:52 UTC (rev 273913)
@@ -406,6 +406,11 @@
 
         for change in patch.splitlines():
             for path in relevant_paths:
+                if sys.version_info > (3, 0):
+                    if type(path) == str:
+                        path = path.encode(encoding='utf-8', errors='replace')
+                    if type(change) == str:
+                        change = change.encode(encoding='utf-8', errors='replace')
                 if re.search(path, change, re.IGNORECASE):
                     return True
         return False

Modified: trunk/Tools/CISupport/ews-build/steps_unittest.py (273912 => 273913)


--- trunk/Tools/CISupport/ews-build/steps_unittest.py	2021-03-04 20:12:09 UTC (rev 273912)
+++ trunk/Tools/CISupport/ews-build/steps_unittest.py	2021-03-04 20:42:52 UTC (rev 273913)
@@ -2437,7 +2437,7 @@
         return rc
 
     def test_relevant_windows_wk1_patch(self):
-        CheckPatchRelevance._get_patch = lambda x: 'Sample patch; file: Source/WebKitLegacy'
+        CheckPatchRelevance._get_patch = lambda x: b'Sample patch; file: Source/WebKitLegacy'
         self.setupStep(CheckPatchRelevance())
         self.setProperty('buildername', 'Windows-EWS')
         self.expectOutcome(result=SUCCESS, state_string='Patch contains relevant changes')

Modified: trunk/Tools/ChangeLog (273912 => 273913)


--- trunk/Tools/ChangeLog	2021-03-04 20:12:09 UTC (rev 273912)
+++ trunk/Tools/ChangeLog	2021-03-04 20:42:52 UTC (rev 273913)
@@ -1,3 +1,15 @@
+2021-03-04  Aakash Jain  <aakash_j...@apple.com>
+
+        [ews] Add python 3 support - part 5
+        https://bugs.webkit.org/show_bug.cgi?id=222744
+
+        Reviewed by Jonathan Bedard.
+
+        * CISupport/ews-build/steps.py:
+        (CheckPatchRelevance._patch_is_relevant): Ensure that in python 3, path and changes are bytes. This is because buildbot
+        stores patch as bytes, as mentioned in https://github.com/buildbot/buildbot/issues/5812#issuecomment-790175979
+        * CISupport/ews-build/steps_unittest.py: Updated one unit-test to test binary patch.
+
 2021-03-04  Chris Dumez  <cdu...@apple.com>
 
         [macOS][WK2] Changing the system language does not update navigator.language
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to