aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/scripts/coverage.py
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2021-06-22 22:59:16 +0200
committerDaniel Mensinger <daniel@mensinger-ka.de>2021-06-29 11:28:08 +0200
commit3e396b3782813d36d46195564cd0e111422bcaf5 (patch)
treef315e990f71984745fcb8f22dac2f0e400fecadb /mesonbuild/scripts/coverage.py
parent28175bbee2c111cf41b80c97bbadd7dbabaa8990 (diff)
downloadmeson-3e396b3782813d36d46195564cd0e111422bcaf5.zip
meson-3e396b3782813d36d46195564cd0e111422bcaf5.tar.gz
meson-3e396b3782813d36d46195564cd0e111422bcaf5.tar.bz2
fix: Always explicitly set encoding for text files (fixes #8263)
Diffstat (limited to 'mesonbuild/scripts/coverage.py')
-rw-r--r--mesonbuild/scripts/coverage.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/scripts/coverage.py b/mesonbuild/scripts/coverage.py
index f8a4924..b60d5d1 100644
--- a/mesonbuild/scripts/coverage.py
+++ b/mesonbuild/scripts/coverage.py
@@ -68,11 +68,11 @@ def coverage(outputs: T.List[str], source_root: str, subproject_root: str, build
# Create a shim to allow using llvm-cov as a gcov tool.
if mesonlib.is_windows():
llvm_cov_shim_path = os.path.join(log_dir, 'llvm-cov.bat')
- with open(llvm_cov_shim_path, 'w') as llvm_cov_bat:
+ with open(llvm_cov_shim_path, 'w', encoding='utf-8') as llvm_cov_bat:
llvm_cov_bat.write(f'@"{llvm_cov_exe}" gcov %*')
else:
llvm_cov_shim_path = os.path.join(log_dir, 'llvm-cov.sh')
- with open(llvm_cov_shim_path, 'w') as llvm_cov_sh:
+ with open(llvm_cov_shim_path, 'w', encoding='utf-8') as llvm_cov_sh:
llvm_cov_sh.write(f'#!/usr/bin/env sh\nexec "{llvm_cov_exe}" gcov $@')
os.chmod(llvm_cov_shim_path, os.stat(llvm_cov_shim_path).st_mode | stat.S_IEXEC)
gcov_tool_args = ['--gcov-tool', llvm_cov_shim_path]