[libcxx-commits] [libcxx] e1cdfc8 - [libc++] Fix missing encoding in open() call in python script (#154594)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Sep 5 01:00:35 PDT 2025


Author: Adam
Date: 2025-09-05T16:00:31+08:00
New Revision: e1cdfc814c5571c1bc5db342c1241ea9c5b55b17

URL: https://github.com/llvm/llvm-project/commit/e1cdfc814c5571c1bc5db342c1241ea9c5b55b17
DIFF: https://github.com/llvm/llvm-project/commit/e1cdfc814c5571c1bc5db342c1241ea9c5b55b17.diff

LOG: [libc++] Fix missing encoding in open() call in python script (#154594)

This is a simple fix for the script not being able to run on some
platforms due to a missing encoding parameter.

Co-authored-by: siradam7th <siradam7th at users.noreply.github.com>

Added: 
    

Modified: 
    libcxx/utils/generate_libcxx_cppm_in.py

Removed: 
    


################################################################################
diff  --git a/libcxx/utils/generate_libcxx_cppm_in.py b/libcxx/utils/generate_libcxx_cppm_in.py
index 39076a61b55b8..26d680a0db31f 100644
--- a/libcxx/utils/generate_libcxx_cppm_in.py
+++ b/libcxx/utils/generate_libcxx_cppm_in.py
@@ -9,11 +9,19 @@
 import os.path
 import sys
 
-from libcxx.header_information import module_c_headers, module_headers, header_restrictions, headers_not_available, libcxx_root
+from libcxx.header_information import (
+    module_c_headers,
+    module_headers,
+    header_restrictions,
+    headers_not_available,
+    libcxx_root,
+)
 
 
 def write_file(module):
-    with open(libcxx_root / "modules" / f"{module}.cppm.in", "w") as module_cpp_in:
+    with open(
+        libcxx_root / "modules" / f"{module}.cppm.in", "w", encoding="utf-8"
+    ) as module_cpp_in:
         module_cpp_in.write(
             """\
 // -*- C++ -*-


        


More information about the libcxx-commits mailing list