pungi/tests
Adam Williamson f3dcb036a5 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
(cherry picked from commit 2d16a3af004f61cf41e4eb2e5e694bb46a5d3cda)
2025-09-29 18:27:13 +03:00
..
data comps: Apply arch filtering to environment/optionlist 2023-11-10 16:51:52 +02:00
fixtures - Fix unittests 2022-11-08 14:57:52 +02:00
__init__.py Fix test data, improve Makefile. 2015-06-25 08:02:57 -04:00
Dockerfile-test Install dnf4 into test image 2025-09-29 18:15:21 +03:00
helpers.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
Jenkinsfile Remove pungi/gather.py and associated code 2025-09-29 18:16:18 +03:00
test_arch.py - Use unittest.mock instead external mock 2022-11-11 15:32:00 +02:00
test_arguments.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_buildinstall.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_checks.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_compose.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_compose.sh tests: Fix test_compose.sh paths 2017-08-10 09:28:36 +02:00
test_comps_wrapper.py Drop unittest2 2025-09-29 18:19:14 +03:00
test_config_utils.py Drop unittest2 2025-09-29 18:19:14 +03:00
test_config_validate_script.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_config.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_create_extra_repo.py ALBS-987: Generate i686 and dev repositories with pungi on building new distr. version automatically 2023-03-30 12:52:51 +03:00
test_create_packages_json.py - Bump version 2023-11-15 14:49:51 +02:00
test_createiso_phase.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_createiso_script.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_createrepo_wrapper.py Drop usage of six 2025-09-29 18:23:44 +03:00
test_createrepophase.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_extra_files_phase.py Download extra files from container registry 2025-09-29 18:27:12 +03:00
test_extra_isos_phase.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_fus_wrapper.py Drop usage of six 2025-09-29 18:23:44 +03:00
test_gather_method_deps.py - Use unittest.mock instead external mock 2022-11-11 15:32:00 +02:00
test_gather_method_hybrid.py Drop usage of six 2025-09-29 18:23:44 +03:00
test_gather_method_nodeps.py Drop usage of six 2025-09-29 18:23:44 +03:00
test_gather_modules.py - kojimock is added to pungi.phases.gather._make_lookaside_repo#prefixes 2022-11-09 20:56:56 +02:00
test_gather_phase.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_gather_rpms.py AL-5220: Investigate why CL9 can't built on the new nebula 2023-07-24 18:26:51 +03:00
test_gather_source_module.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_gather.py Drop usage of six 2025-09-29 18:23:44 +03:00
test_graph.py Drop unittest2 2025-09-29 18:19:14 +03:00
test_image_container_phase.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_imagebuildphase.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_imagechecksumphase.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_initphase.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_iso_wrapper.py Protect against decoding errors with subprocess text mode 2025-09-29 18:27:13 +03:00
test_kiwibuildphase.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_koji_local_source.py ALBS-1040: Investigate why Pungi doesn't put modules packages into the final repos 2023-03-14 18:43:14 +02:00
test_koji_wrapper.py Protect against decoding errors with subprocess text mode 2025-09-29 18:27:13 +03:00
test_linker.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_liveimagesphase.py Remove live_images.py (LiveImagesPhase) 2024-08-30 13:40:14 +03:00
test_livemediaphase.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_lorax_wrapper.py Drop usage of six 2025-09-29 18:23:44 +03:00
test_media_split.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_metadata.py Drop usage of six 2025-09-29 18:23:44 +03:00
test_module_util.py Drop unittest2 2025-09-29 18:19:14 +03:00
test_notifier.py Protect against decoding errors with subprocess text mode 2025-09-29 18:27:13 +03:00
test_osbs_phase.py Various phases: consistent format of failure message 2024-08-30 13:39:40 +03:00
test_osbuild_phase.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_ostree_installer_phase.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_ostree_phase.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_ostree_script.py Protect against decoding errors with subprocess text mode 2025-09-29 18:27:13 +03:00
test_ostree_utils.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_patch_iso.py Protect against decoding errors with subprocess text mode 2025-09-29 18:27:13 +03:00
test_phase_base.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_pkgset_common.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_pkgset_phase.py Move test for unsigned packages with pkgset_koji_scratch_tasks to PkgsetPhase class. 2020-06-11 12:05:47 +00:00
test_pkgset_pkgsets.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_pkgset_source_koji.py Directly import mock from unittest 2025-09-29 18:26:35 +03:00
test_repoclosure_phase.py Drop usage of six 2025-09-29 18:23:44 +03:00
test_repoclosure_wrapper.py Drop usage of six 2025-09-29 18:23:44 +03:00
test_runroot.py Make latest black happy 2024-08-30 13:31:29 +03:00
test_scm.py Download extra files from container registry 2025-09-29 18:27:12 +03:00
test_test_phase.py Remove pungi/gather.py and associated code 2025-09-29 18:16:18 +03:00
test_unified_isos.py Protect against decoding errors with subprocess text mode 2025-09-29 18:27:13 +03:00
test_util.py Protect against decoding errors with subprocess text mode 2025-09-29 18:27:13 +03:00
test_variant_wrapper.py Drop usage of six 2025-09-29 18:23:44 +03:00