aboutsummaryrefslogtreecommitdiff
path: root/tools/boost_names.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 /tools/boost_names.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 'tools/boost_names.py')
-rwxr-xr-xtools/boost_names.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/boost_names.py b/tools/boost_names.py
index 89926ec..b716ccb 100755
--- a/tools/boost_names.py
+++ b/tools/boost_names.py
@@ -78,7 +78,7 @@ class BoostModule():
def get_boost_version() -> T.Optional[str]:
- raw = jamroot.read_text()
+ raw = jamroot.read_text(encoding='utf-8')
m = re.search(r'BOOST_VERSION\s*:\s*([0-9\.]+)\s*;', raw)
if m:
return m.group(1)
@@ -91,7 +91,7 @@ def get_libraries(jamfile: Path) -> T.List[BoostLibrary]:
# - compiler flags
libs: T.List[BoostLibrary] = []
- raw = jamfile.read_text()
+ raw = jamfile.read_text(encoding='utf-8')
raw = re.sub(r'#.*\n', '\n', raw) # Remove comments
raw = re.sub(r'\s+', ' ', raw) # Force single space
raw = re.sub(r'}', ';', raw) # Cheat code blocks by converting } to ;
@@ -185,7 +185,7 @@ def process_lib_dir(ldir: Path) -> T.List[BoostModule]:
libs = get_libraries(bjam_file)
# Extract metadata
- data = json.loads(meta_file.read_text())
+ data = json.loads(meta_file.read_text(encoding='utf-8'))
if not isinstance(data, list):
data = [data]