Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions mesonpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ def __init__(
self._limited_api = False

# load pyproject.toml
pyproject = tomllib.loads(self._source_dir.joinpath('pyproject.toml').read_text())
pyproject = tomllib.loads(self._source_dir.joinpath('pyproject.toml').read_text(encoding='utf-8'))

# load meson args from pyproject.toml
pyproject_config = _validate_pyproject_config(pyproject)
Expand Down Expand Up @@ -703,15 +703,15 @@ def __init__(
cpu_family = {family!r}
endian = 'little'
''')
self._meson_cross_file.write_text(cross_file_data)
self._meson_cross_file.write_text(cross_file_data, encoding='utf-8')
self._meson_args['setup'].extend(('--cross-file', os.fspath(self._meson_cross_file)))

# write the native file
native_file_data = textwrap.dedent(f'''
[binaries]
python = '{sys.executable}'
''')
self._meson_native_file.write_text(native_file_data)
self._meson_native_file.write_text(native_file_data, encoding='utf-8')

# reconfigure if we have a valid Meson build directory. Meson
# uses the presence of the 'meson-private/coredata.dat' file
Expand Down Expand Up @@ -818,7 +818,7 @@ def build(self) -> None:
def _info(self, name: str) -> Any:
"""Read info from meson-info directory."""
info = self._build_dir.joinpath('meson-info', f'{name}.json')
return json.loads(info.read_text())
return json.loads(info.read_text(encoding='utf-8'))

@property
def _manifest(self) -> DefaultDict[str, List[Tuple[pathlib.Path, str]]]:
Expand Down