From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org, "Daniel P . Berrangé" <berrange@redhat.com>
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH v2 1/5] tests/lcitool/refresh: Treat the output of lcitool as text, not as bytes
Date: Thu, 16 May 2024 10:40:55 +0200 [thread overview]
Message-ID: <20240516084059.511463-2-thuth@redhat.com> (raw)
In-Reply-To: <20240516084059.511463-1-thuth@redhat.com>
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>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/lcitool/refresh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh
index 24a735a3f2..174818d9c9 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)
--
2.45.0
next prev parent reply other threads:[~2024-05-16 8:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-16 8:40 [PATCH v2 0/5] tests: Remove xfsprogs and g++ from the dockerfiles Thomas Huth
2024-05-16 8:40 ` Thomas Huth [this message]
2024-05-16 8:55 ` [PATCH v2 1/5] tests/lcitool/refresh: Treat the output of lcitool as text, not as bytes Daniel P. Berrangé
2024-05-16 8:40 ` [PATCH v2 2/5] tests/lcitool: Remove 'xfsprogs' from QEMU Thomas Huth
2024-05-16 8:55 ` Daniel P. Berrangé
2024-05-16 8:40 ` [PATCH v2 3/5] tests/lcitool: Remove g++ from the containers (except for the MinGW one) Thomas Huth
2024-05-16 8:56 ` Daniel P. Berrangé
2024-05-16 8:40 ` [PATCH v2 4/5] tests/lcitool/projects/qemu.yml: Sort entries alphabetically again Thomas Huth
2024-05-16 8:56 ` Daniel P. Berrangé
2024-05-16 8:40 ` [PATCH v2 5/5] tests/docker/dockerfiles: Update container files with "lcitool-refresh" Thomas Huth
2024-05-16 8:59 ` Daniel P. Berrangé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240516084059.511463-2-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).