From 48224c7853353ad5b007a982f292b1674e0bfbcf Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Tue, 1 Dec 2020 11:23:04 -0500 Subject: [PATCH] MockModuleBuilder: fix an encoding error running under Python 2.7 --- module_build_service/builder/MockModuleBuilder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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=""):