diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 1da73abced..2a3b1e5a47 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 = ''