From 80b5f4ff088d878378c1907a8703659ac838d97b Mon Sep 17 00:00:00 2001 From: Jeremy Newton Date: Wed, 25 Aug 2021 17:03:23 -0400 Subject: [PATCH] Fix building AMD MM/GL with EL7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This partially reverts commit 4d9acfa5331be6140e84badff7a232dbf07b69b4. The original patch said: "Python 3 handles unicode strings by default, so we can drop all that." But this breaks building on RHEL 7 (or similiar) since python3 support on is much more limited than newer distros. Backporting all the needed python 3 libraries to EL7 is a pretty big task, and isn't very easy to maintain. For workstation purposes, we need the AMD MM/GL driver building on RHEL 7, so only src/util/driconf_static.py needs to be reverted. Reviewed-by: Marek Olšák Signed-off-by: Jeremy Newton Part-of: --- src/util/driconf_static.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/driconf_static.py b/src/util/driconf_static.py index d806c2554b4..cd03d17508f 100644 --- a/src/util/driconf_static.py +++ b/src/util/driconf_static.py @@ -223,6 +223,6 @@ static const struct driconf_device *driconf[] = { xml = sys.argv[1] dst = sys.argv[2] -with open(dst, 'w') as f: - f.write(Template(template).render(driconf=DriConf(xml))) +with open(dst, 'wb') as f: + f.write(Template(template, output_encoding='utf-8').render(driconf=DriConf(xml)))