diff options
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r-- | mesonbuild/modules/cmake.py | 2 | ||||
-rw-r--r-- | mesonbuild/modules/dlang.py | 4 | ||||
-rw-r--r-- | mesonbuild/modules/gnome.py | 2 | ||||
-rw-r--r-- | mesonbuild/modules/hotdoc.py | 2 | ||||
-rw-r--r-- | mesonbuild/modules/keyval.py | 2 | ||||
-rw-r--r-- | mesonbuild/modules/rpm.py | 2 | ||||
-rw-r--r-- | mesonbuild/modules/unstable_external_project.py | 2 |
7 files changed, 8 insertions, 8 deletions
diff --git a/mesonbuild/modules/cmake.py b/mesonbuild/modules/cmake.py index cb37edc..c390b01 100644 --- a/mesonbuild/modules/cmake.py +++ b/mesonbuild/modules/cmake.py @@ -298,7 +298,7 @@ class CmakeModule(ExtensionModule): package_init += PACKAGE_INIT_SET_AND_CHECK try: - with open(infile) as fin: + with open(infile, encoding='utf-8') as fin: data = fin.readlines() except Exception as e: raise mesonlib.MesonException('Could not read input file {}: {}'.format(infile, str(e))) diff --git a/mesonbuild/modules/dlang.py b/mesonbuild/modules/dlang.py index e2a55b6..b6efc86 100644 --- a/mesonbuild/modules/dlang.py +++ b/mesonbuild/modules/dlang.py @@ -70,7 +70,7 @@ class DlangModule(ExtensionModule): config_path = os.path.join(args[1], 'dub.json') if os.path.exists(config_path): - with open(config_path, encoding='utf8') as ofile: + with open(config_path, encoding='utf-8') as ofile: try: config = json.load(ofile) except ValueError: @@ -108,7 +108,7 @@ class DlangModule(ExtensionModule): else: config[key] = value - with open(config_path, 'w', encoding='utf8') as ofile: + with open(config_path, 'w', encoding='utf-8') as ofile: ofile.write(json.dumps(config, indent=4, ensure_ascii=False)) def _call_dubbin(self, args, env=None): diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index efd1f00..1b68f6c 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -1713,7 +1713,7 @@ G_END_DECLS''' def _generate_deps(self, state, library, packages, install_dir): outdir = state.environment.scratch_dir fname = os.path.join(outdir, library + '.deps') - with open(fname, 'w') as ofile: + with open(fname, 'w', encoding='utf-8') as ofile: for package in packages: ofile.write(package + '\n') return build.Data([mesonlib.File(True, outdir, fname)], install_dir, None, state.subproject) diff --git a/mesonbuild/modules/hotdoc.py b/mesonbuild/modules/hotdoc.py index 26026fb..4dccd06 100644 --- a/mesonbuild/modules/hotdoc.py +++ b/mesonbuild/modules/hotdoc.py @@ -310,7 +310,7 @@ class HotdocTargetBuilder: hotdoc_config_name = fullname + '.json' hotdoc_config_path = os.path.join( self.builddir, self.subdir, hotdoc_config_name) - with open(hotdoc_config_path, 'w') as f: + with open(hotdoc_config_path, 'w', encoding='utf-8') as f: f.write('{}') self.cmd += ['--conf-file', hotdoc_config_path] diff --git a/mesonbuild/modules/keyval.py b/mesonbuild/modules/keyval.py index d637ac0..b2d54db 100644 --- a/mesonbuild/modules/keyval.py +++ b/mesonbuild/modules/keyval.py @@ -32,7 +32,7 @@ class KeyvalModule(ExtensionModule): def _load_file(self, path_to_config): result = dict() try: - with open(path_to_config) as f: + with open(path_to_config, encoding='utf-8') as f: for line in f: if '#' in line: comment_idx = line.index('#') diff --git a/mesonbuild/modules/rpm.py b/mesonbuild/modules/rpm.py index 704e82b..1fae144 100644 --- a/mesonbuild/modules/rpm.py +++ b/mesonbuild/modules/rpm.py @@ -77,7 +77,7 @@ class RPMModule(ExtensionModule): filename = os.path.join(state.environment.get_build_dir(), '%s.spec' % proj) - with open(filename, 'w+') as fn: + with open(filename, 'w+', encoding='utf-8') as fn: fn.write('Name: %s\n' % proj) fn.write('Version: # FIXME\n') fn.write('Release: 1%{?dist}\n') diff --git a/mesonbuild/modules/unstable_external_project.py b/mesonbuild/modules/unstable_external_project.py index e997f6a..4f8ac56 100644 --- a/mesonbuild/modules/unstable_external_project.py +++ b/mesonbuild/modules/unstable_external_project.py @@ -162,7 +162,7 @@ class ExternalProject(ModuleObject): log_filename = Path(mlog.log_dir, f'{self.name}-{step}.log') output = None if not self.verbose: - output = open(log_filename, 'w') + output = open(log_filename, 'w', encoding='utf-8') output.write(m + '\n') output.flush() else: |