Handle gracefully debian stuff when testing on rhel-like
Some checks failed
CI / test (push) Has been cancelled
Lint / test (push) Has been cancelled
CI / test (almalinux, docker.io/library/almalinux:9, python3.11) (push) Failing after 5m10s
CI / test (debian, docker.io/library/debian:13, python3) (push) Failing after 10m10s

This commit is contained in:
Miguel Jacq 2026-06-21 16:15:33 +10:00
parent b704a6c80b
commit ce2652a3b3
Signed by: mig5
GPG key ID: 03906B4110AAD3B8
2 changed files with 12 additions and 1 deletions

View file

@ -186,7 +186,12 @@ def parse_status_conffiles(
if m:
out[pkg] = m
with open(status_path, "r", encoding="utf-8", errors="replace") as f:
try:
f = open(status_path, "r", encoding="utf-8", errors="replace")
except OSError:
return out
with f:
for line in f:
if line.strip() == "":
if cur:

View file

@ -280,6 +280,12 @@ def test_build_dpkg_etc_index_skips_non_etc_paths(tmp_path: Path):
assert "foo" not in topdir_to_pkgs
def test_parse_status_conffiles_handles_missing_status(tmp_path: Path):
import enroll.debian as d
assert d.parse_status_conffiles(str(tmp_path / "missing-status")) == {}
def test_parse_status_conffiles_handles_empty_status(tmp_path: Path):
import enroll.debian as d