tumbi-assembler/pungi
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
..
compose_metadata Format code base with black 2020-02-05 17:35:47 +08:00
ostree Protect against decoding errors with subprocess text mode 2025-01-16 09:20:27 +01:00
phases Protect against decoding errors with subprocess text mode 2025-01-16 09:20:27 +01:00
scripts Drop usage of six 2024-11-29 09:29:20 +01:00
wrappers Protect against decoding errors with subprocess text mode 2025-01-16 09:20:27 +01:00
__init__.py Protect against decoding errors with subprocess text mode 2025-01-16 09:20:27 +01:00
arch.py Format code base with black 2020-02-05 17:35:47 +08:00
arch_utils.py Format code 2021-03-02 18:31:45 +08:00
checks.py Drop usage of six 2024-11-29 09:29:20 +01:00
common.py Format code base with black 2020-02-05 17:35:47 +08:00
compose.py Remove pungi/gather.py and associated code 2024-11-19 14:23:15 +01:00
createiso.py Drop usage of six 2024-11-29 09:29:20 +01:00
dnf_wrapper.py Format code base with black 2020-02-05 17:35:47 +08:00
errors.py Move UnsignedPackagesError to a separate file 2021-02-08 10:16:32 +00:00
gather_dnf.py Remove pungi/gather.py and associated code 2024-11-19 14:23:15 +01:00
graph.py Format code 2021-03-02 18:31:45 +08:00
ks.py Format code base with black 2020-02-05 17:35:47 +08:00
linker.py Hardlink or copy scratch builds always 2020-08-07 18:00:19 +08:00
media_split.py Fix black complaint 2022-08-10 09:04:41 +02:00
metadata.py Remove useless debug message 2023-05-30 15:46:17 +02:00
module_util.py Fix module defaults and obsoletes validation 2022-06-10 11:35:26 +00:00
multilib_dnf.py Format code base with black 2020-02-05 17:35:47 +08:00
notifier.py Protect against decoding errors with subprocess text mode 2025-01-16 09:20:27 +01:00
paths.py Add module obsoletes feature 2022-01-12 12:51:37 +01:00
profiler.py profiler: Flush stdout before printing 2022-08-29 05:57:14 +00:00
runroot.py Drop usage of six 2024-11-29 09:29:20 +01:00
util.py Protect against decoding errors with subprocess text mode 2025-01-16 09:20:27 +01:00