diff --git a/archinstall/lib/configuration.py b/archinstall/lib/configuration.py index c21b1447de..aa04a53369 100644 --- a/archinstall/lib/configuration.py +++ b/archinstall/lib/configuration.py @@ -1,5 +1,4 @@ import json -import os import readline import stat from pathlib import Path @@ -117,14 +116,14 @@ def save_user_config(self, dest_path: Path) -> None: if self._is_valid_path(dest_path): target = dest_path / self._user_config_file target.write_text(self.user_config_to_json()) - os.chmod(target, stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP) + target.chmod(stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP) def save_user_creds(self, dest_path: Path) -> None: if self._is_valid_path(dest_path): if user_creds := self.user_credentials_to_json(): target = dest_path / self._user_creds_file target.write_text(user_creds) - os.chmod(target, stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP) + target.chmod(stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP) def save(self, dest_path: Path | None = None) -> None: dest_path = dest_path or self._default_save_path diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py index df8bba5143..4d01f78741 100644 --- a/archinstall/lib/general.py +++ b/archinstall/lib/general.py @@ -257,7 +257,7 @@ def peak(self, output: str | bytes) -> bool: peek_output_log.write(str(output)) if change_perm: - os.chmod(str(peak_logfile), stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP) + peak_logfile.chmod(stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP) sys.stdout.write(str(output)) sys.stdout.flush() @@ -317,7 +317,7 @@ def execute(self) -> bool: cmd_log.write(f"{time.time()} {self.cmd}\n") if change_perm: - os.chmod(str(history_logfile), stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP) + history_logfile.chmod(stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP) except (PermissionError, FileNotFoundError): # If history_logfile does not exist, ignore the error pass