Fix: Decode run_cmd() result

Since commit 02697af5, ExecContext.run() returns bytes for stdout and stderr and fixes that in calling code. The thing it did not fix was the code calling run_cmd(), which also made return bytes. This commit catches up on that.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-03-23 13:13:55 +01:00
commit 21e67291b5
6 changed files with 12 additions and 14 deletions

View file

@ -38,8 +38,8 @@ async def query_packages(names: Iterable[str] = [], ec: ExecContext=None) -> Ite
if not names:
opts.append('-a')
specs, stderr, status = await run_rpm([*opts, *names], throw=True, sudo=False, ec=ec)
return Package.parse_specs_str(specs)
return Package.parse_specs_str(specs.decode())
async def list_files(pkg: str, ec: ExecContext=None) -> list[str]: # export
file_list_str, stderr, status = await run_rpm(['-ql', pkg], throw=True, sudo=False, ec=ec)
return file_list_str.splitlines()
stdout, stderr, status = await run_rpm(['-ql', pkg], throw=True, sudo=False, ec=ec)
return stdout.decode().splitlines()