diff --git a/module_build_service/builder/MockModuleBuilder.py b/module_build_service/builder/MockModuleBuilder.py index 5fb4cabd..df9a1b86 100644 --- a/module_build_service/builder/MockModuleBuilder.py +++ b/module_build_service/builder/MockModuleBuilder.py @@ -413,8 +413,8 @@ class MockModuleBuilder(GenericBuilder): # ...and inject modules.yaml there if asked. if include_module_yaml: mmd_path = os.path.join(path, "modules.yaml") - with open(mmd_path, "w") as f: - f.write(mmd_to_str(m1_mmd)) + with open(mmd_path, "wb") as f: + f.write(mmd_to_str(m1_mmd).encode("utf-8")) execute_cmd(["/usr/bin/modifyrepo_c", "--mdtype=modules", mmd_path, repodata_path]) def _add_repo(self, name, baseurl, extra=""):