Title: [234711] trunk/Tools
Revision
234711
Author
[email protected]
Date
2018-08-08 14:54:50 -0700 (Wed, 08 Aug 2018)

Log Message

run-builtins-generator-tests does not correctly handle CRLFs from stderr
https://bugs.webkit.org/show_bug.cgi?id=188392

Reviewed by Fujii Hironori.

Background:
file.write converts LF to os.linesep, so if the input string contains CRLF, we end up writing CRCRLF to the file.

* Scripts/webkitpy/common/system/executive.py:
(Executive.run_command):
Normalize CRLF to LF in decoded stdout/stderr data, so that we don't return consumers a platform-specific string.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (234710 => 234711)


--- trunk/Tools/ChangeLog	2018-08-08 20:54:05 UTC (rev 234710)
+++ trunk/Tools/ChangeLog	2018-08-08 21:54:50 UTC (rev 234711)
@@ -1,3 +1,17 @@
+2018-08-08  Ross Kirsling  <[email protected]>
+
+        run-builtins-generator-tests does not correctly handle CRLFs from stderr
+        https://bugs.webkit.org/show_bug.cgi?id=188392
+
+        Reviewed by Fujii Hironori.
+
+        Background:
+        file.write converts LF to os.linesep, so if the input string contains CRLF, we end up writing CRCRLF to the file.
+
+        * Scripts/webkitpy/common/system/executive.py:
+        (Executive.run_command):
+        Normalize CRLF to LF in decoded stdout/stderr data, so that we don't return consumers a platform-specific string.
+
 2018-08-08  Aditya Keerthi  <[email protected]>
 
         Unreviewed, add myself to committers list.

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


--- trunk/Tools/Scripts/webkitpy/common/system/executive.py	2018-08-08 20:54:05 UTC (rev 234710)
+++ trunk/Tools/Scripts/webkitpy/common/system/executive.py	2018-08-08 21:54:50 UTC (rev 234711)
@@ -386,9 +386,9 @@
                              close_fds=self._should_close_fds())
         output = process.communicate(string_to_communicate)[0]
 
-        # run_command automatically decodes to unicode() unless explicitly told not to.
+        # run_command automatically decodes to unicode() and converts CRLF to LF unless explicitly told not to.
         if decode_output:
-            output = output.decode(self._child_process_encoding())
+            output = output.decode(self._child_process_encoding()).replace('\r\n', '\n')
 
         # wait() is not threadsafe and can throw OSError due to:
         # http://bugs.python.org/issue1731717
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to