From 4212357c6fa22ae1b7c587b8993d91885d66bd45 Mon Sep 17 00:00:00 2001 From: correctmost <134317971+correctmost@users.noreply.github.com> Date: Sun, 12 Jan 2025 00:50:09 +0000 Subject: [PATCH] Use removeprefix/removesuffix instead of incorrect lstrip/rstrip calls (#3109) --- archinstall/lib/installer.py | 2 +- archinstall/lib/models/mirrors.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 6e669b8c2a..43ef6ac4ed 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -1633,7 +1633,7 @@ def _service_started(self, service_name: str) -> str | None: last_execution_time = SysCommand( f"systemctl show --property=ActiveEnterTimestamp --no-pager {service_name}", environment_vars={'SYSTEMD_COLORS': '0'} - ).decode().lstrip('ActiveEnterTimestamp=') + ).decode().removeprefix('ActiveEnterTimestamp=') if not last_execution_time: return None diff --git a/archinstall/lib/models/mirrors.py b/archinstall/lib/models/mirrors.py index 09aec8f392..9d3adbc7f1 100644 --- a/archinstall/lib/models/mirrors.py +++ b/archinstall/lib/models/mirrors.py @@ -254,7 +254,7 @@ def _parse_locale_mirrors(self, mirrorlist: str) -> dict[str, list[MirrorStatusE url = line.removeprefix('Server = ') mirror_entry = MirrorStatusEntryV3( - url=url.rstrip('$repo/os/$arch'), + url=url.removesuffix('$repo/os/$arch'), protocol=urllib.parse.urlparse(url).scheme, active=True, country=current_region or 'Worldwide',