[glibmm/glibmm-2-68] handle-built-files.py: Specify file encoding on generated files
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm/glibmm-2-68] handle-built-files.py: Specify file encoding on generated files
- Date: Fri, 16 Jul 2021 12:54:34 +0000 (UTC)
commit 12ca841445cfa659349e6e76c8b8c53a988c0e7c
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Fri Jul 16 13:45:05 2021 +0200
handle-built-files.py: Specify file encoding on generated files
The default file encoding is platform dependent in Python.
Better specify which encoding is preferred.
tools/build_scripts/handle-built-files.py | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/tools/build_scripts/handle-built-files.py b/tools/build_scripts/handle-built-files.py
index e22600b4..c96de2ad 100755
--- a/tools/build_scripts/handle-built-files.py
+++ b/tools/build_scripts/handle-built-files.py
@@ -83,11 +83,8 @@ def build_from_m4():
'-I', include_dir,
input_file,
]
- output_file_obj = open(output_file, mode='w')
- result = subprocess.run(cmd, stdout=output_file_obj)
- output_file_obj.close()
-
- return result.returncode
+ with open(output_file, mode='w', encoding='utf-8') as output_file_obj:
+ return subprocess.run(cmd, stdout=output_file_obj).returncode
# Invoked from meson.add_install_script().
def install_built_h_files():
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]