Title: [293307] trunk/Source/WebKit
Revision
293307
Author
[email protected]
Date
2022-04-24 14:16:48 -0700 (Sun, 24 Apr 2022)

Log Message

Use utf-8 for text mode files in generate-automation-atom.py
https://bugs.webkit.org/show_bug.cgi?id=239542

Patch by Daniel Kolesa <[email protected]> on 2022-04-24
Reviewed by Adrian Perez de Castro.

At least with older versions of python (3.6), this will otherwise
be ascii, which will break input files that contain non-ascii
characters, e.g. Source/WebKit/UIProcess/Automation/atoms/FindNodes.js

* Scripts/generate-automation-atom.py:
(main):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (293306 => 293307)


--- trunk/Source/WebKit/ChangeLog	2022-04-24 20:28:58 UTC (rev 293306)
+++ trunk/Source/WebKit/ChangeLog	2022-04-24 21:16:48 UTC (rev 293307)
@@ -1,3 +1,17 @@
+2022-04-24  Daniel Kolesa  <[email protected]>
+
+        Use utf-8 for text mode files in generate-automation-atom.py
+        https://bugs.webkit.org/show_bug.cgi?id=239542
+
+        Reviewed by Adrian Perez de Castro.
+
+        At least with older versions of python (3.6), this will otherwise
+        be ascii, which will break input files that contain non-ascii
+        characters, e.g. Source/WebKit/UIProcess/Automation/atoms/FindNodes.js
+
+        * Scripts/generate-automation-atom.py:
+        (main):
+
 2022-04-23  Wenson Hsieh  <[email protected]>
 
         Remove the `PreferInlineTextSelectionInImages` internal feature flag

Modified: trunk/Source/WebKit/Scripts/generate-automation-atom.py (293306 => 293307)


--- trunk/Source/WebKit/Scripts/generate-automation-atom.py	2022-04-24 20:28:58 UTC (rev 293306)
+++ trunk/Source/WebKit/Scripts/generate-automation-atom.py	2022-04-24 21:16:48 UTC (rev 293307)
@@ -75,7 +75,7 @@
     output = args[1]
     utils = os.path.join(os.path.dirname(input), "utils.js")
 
-    with open(input, "r") as fd:
+    with open(input, "r", encoding="utf-8") as fd:
         input_data = fd.read()
 
     util_functions = collect_utils(input_data)
@@ -87,7 +87,7 @@
         append_functions(utils_data, util_functions, util_functions_impl, functions_written)
         input_data = input_data.replace('"use strict";\n', '"use strict";\n\n' + "\n".join(utils_data))
 
-    with open(output, "w") as fd:
+    with open(output, "w", encoding="utf-8") as fd:
         fd.write(input_data)
 
     return 0
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to