stages/rpm: set encoding for subprocess.run()

Printing 'owner' in an fstring triggers the mypy warning 'str-bytes-safe'

  Error: If x = b'abc' then f"{x}" or "{}".format(x) produces "b'abc'",
  not "abc".

We can't yet use the nicer run() argument, 'text=True', because we still
target the RHEL 7 build root which only has Python 3.6 and 'text' was
introduced in Python 3.7.
This commit is contained in:
Achilleas Koutsou 2025-03-12 16:08:38 +01:00 committed by Tomáš Hozza
parent 8daf928b62
commit 7be822d6e9

View file

@ -112,6 +112,7 @@ def remove_unowned_etc_kernel(tree, rpm_args):
"--root", tree,
"-qf", "/etc/kernel"],
stdout=subprocess.PIPE,
encoding="utf-8",
check=False)
owner = res.stdout.strip()