aboutsummaryrefslogtreecommitdiff
path: root/tests/lcitool
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2024-05-16 10:40:55 +0200
committerThomas Huth <thuth@redhat.com>2024-05-17 11:15:58 +0200
commit4d8698e692cca96bbf20505a90e42d10141d2b94 (patch)
tree72890261914e8310eea994de7579b218bd046f83 /tests/lcitool
parent85ef20f1673feaa083f4acab8cf054df77b0dbed (diff)
downloadqemu-4d8698e692cca96bbf20505a90e42d10141d2b94.zip
qemu-4d8698e692cca96bbf20505a90e42d10141d2b94.tar.gz
qemu-4d8698e692cca96bbf20505a90e42d10141d2b94.tar.bz2
tests/lcitool/refresh: Treat the output of lcitool as text, not as bytes
In case lcitool fails (e.g. with a python backtrace), this makes the output of lcitool much more readable. Suggested-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20240516084059.511463-2-thuth@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/lcitool')
-rwxr-xr-xtests/lcitool/refresh4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh
index 24a735a..174818d 100755
--- a/tests/lcitool/refresh
+++ b/tests/lcitool/refresh
@@ -43,12 +43,12 @@ def atomic_write(filename, content):
def generate(filename, cmd, trailer):
print("Generate %s" % filename)
- lcitool = subprocess.run(cmd, capture_output=True)
+ lcitool = subprocess.run(cmd, capture_output=True, encoding='utf8')
if lcitool.returncode != 0:
raise Exception("Failed to generate %s: %s" % (filename, lcitool.stderr))
- content = lcitool.stdout.decode("utf8")
+ content = lcitool.stdout
if trailer is not None:
content += trailer
atomic_write(filename, content)