From 2d8a1ea9b3ca7e6185e1f2b7d5b31d3d30fd30fa Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Mon, 25 Mar 2024 17:41:07 +0100 Subject: [PATCH] install: use pathlib.Path.write_bytes construct instead of open + write Signed-off-by: Olivier Gayot --- subiquity/server/controllers/install.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/subiquity/server/controllers/install.py b/subiquity/server/controllers/install.py index db4d0d9d..1f9cd759 100644 --- a/subiquity/server/controllers/install.py +++ b/subiquity/server/controllers/install.py @@ -752,8 +752,7 @@ class InstallController(SubiquityController): else: apt_conf_contents += uu_apt_conf_update_security apt_conf_path = Path(aptdir) / "zzzz-temp-installer-unattended-upgrade" - with open(apt_conf_path, "wb") as apt_conf: - apt_conf.write(apt_conf_contents) + apt_conf_path.write_bytes(apt_conf_contents) try: self.unattended_upgrades_ctx = context self.unattended_upgrades_cmd = await start_curtin_command(