Skip to content

Commit

Permalink
rpmbuild: ignore unicode errors in the command output
Browse files Browse the repository at this point in the history
Fix fedora-copr#3645

This doesn't ignore the whole (lines of) output. Only the broken characters. In
this particular example, there was a problem with the special "u" character in
Tina Müller and the output resulted to Tina Mller and Tina M\xfcller. That is
much better than failing completely.
  • Loading branch information
FrostyX committed Feb 25, 2025
1 parent b580697 commit 4acf287
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rpmbuild/copr_rpmbuild/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def run_cmd(cmd, cwd=".", preexec_fn=None, env=None):

result = munch.Munch(
cmd=cmd,
stdout=stdout.decode('utf-8').strip(),
stderr=stderr.decode('utf-8').strip(),
stdout=stdout.decode('utf-8', errors="ignore").strip(),
stderr=stderr.decode('utf-8', errors="ignore").strip(),
returncode=process.returncode,
cwd=cwd
)
Expand Down

0 comments on commit 4acf287

Please sign in to comment.