From: Joerg Behrmann Date: Thu, 2 Nov 2023 21:19:49 +0000 (+0100) Subject: config: right strip newlines from contents read via path_read_text X-Git-Tag: v19~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35c54c5f916822eb2f325cfca601c16ae7d497c6;p=thirdparty%2Fmkosi.git config: right strip newlines from contents read via path_read_text This so far only affects mkosi.version and mkosi.rootpw. Fixes: 2031 --- diff --git a/mkosi/config.py b/mkosi/config.py index b1612dbc7..82b3b1594 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -2318,8 +2318,11 @@ def parse_config(argv: Sequence[str] = ()) -> tuple[MkosiArgs, tuple[MkosiConfig expandvars=False, ) if p.exists(): - setattr(ns, s.dest, - s.parse(p.read_text() if s.path_read_text else f, getattr(ns, s.dest, None))) + setattr( + ns, + s.dest, + s.parse(p.read_text().rstrip("\n") if s.path_read_text else f, getattr(ns, s.dest, None)), + ) if path.exists(): logging.debug(f"Including configuration file {Path.cwd() / path}")