diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 6c4eeb2cd7..ef92e2b0ae 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -526,8 +526,7 @@ def genfstab(self, flags: str = '-pU') -> None: fp.write(f'{entry}\n') def set_hostname(self, hostname: str) -> None: - with open(f'{self.target}/etc/hostname', 'w') as fh: - fh.write(hostname + '\n') + (self.target / 'etc/hostname').write_text(hostname + '\n') def set_locale(self, locale_config: LocaleConfiguration) -> bool: modifier = ''