tumbi-assembler/pungi/ostree
Adam Williamson 2d16a3af00 Protect against decoding errors with subprocess text mode
All these are calling subprocess in 'text mode', where it will
try to decode stdout/stderr using the default encoding (utf-8
for us). If it doesn't decode, subprocess will raise an exception
and kobo doesn't handle it, it just passes it along to us, so
things blow up - see https://pagure.io/releng/issue/12474 . To
avoid this, let's set `errors="replace"`, which tells the decoder
to replace invalid data with ? characters. This way we should get
as much of the output as can be read, and no crashes.

We also replace `universal_newlines=True` with `text=True` as
the latter is shorter, clearer, and what Python 3 subprocess
wants us to use, it considers `universal_newlines` to just be
a backwards-compatibility thing - "The universal_newlines argument
is equivalent to text and is provided for backwards compatibility"

Signed-off-by: Adam Williamson <awilliam@redhat.com>
Merges: https://pagure.io/pungi/pull-request/1812
2025-01-16 09:20:27 +01:00
..
__init__.py ostree/container: add missing --version arg 2024-03-14 12:28:39 -07:00
base.py [ostree] Add 'tree' sub-command to pungi-make-ostree script 2016-12-12 19:30:35 +08:00
container.py Drop usage of six 2024-11-29 09:29:20 +01:00
installer.py Format code base with black 2020-02-05 17:35:47 +08:00
tree.py Protect against decoding errors with subprocess text mode 2025-01-16 09:20:27 +01:00
utils.py Format code base with black 2020-02-05 17:35:47 +08:00