From: Daan De Meyer Date: Tue, 17 Sep 2024 18:45:25 +0000 (+0200) Subject: Drop support for ; comments X-Git-Tag: v25~284^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfba5cf8f38671abeb2d967b52b231f4ea616cd4;p=thirdparty%2Fmkosi.git Drop support for ; comments Can be part of a pkcs11 URI so let's drop support for ';' for comments. I've never seen anyone use this so it shouldn't be a problem to drop this. --- diff --git a/mkosi/config.py b/mkosi/config.py index 0fc3067fa..e61d5a545 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -1823,11 +1823,9 @@ def parse_ini(path: Path, only_sections: Collection[str] = ()) -> Iterator[tuple value: Optional[str] = None for line in textwrap.dedent(path.read_text()).splitlines(): - # Systemd unit files allow both '#' and ';' to indicate comments so we do the same. - for c in ("#", ";"): - comment = line.find(c) - if comment >= 0: - line = line[:comment] + comment = line.find("#") + if comment >= 0: + line = line[:comment] if not line.strip(): continue diff --git a/tests/test_config.py b/tests/test_config.py index 433510883..8546ac719 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -68,7 +68,6 @@ def test_parse_ini(tmp_path: Path) -> None: ALLCAPS=txt # Comment - ; Another comment [EmptySection] [AnotherSection] EmptyValue=