From f075cc668b1abaf15f447155fd36c150a0ccc5db Mon Sep 17 00:00:00 2001 From: Kumi Date: Thu, 18 Jul 2024 18:50:58 +0200 Subject: [PATCH] fix(config): resolve tempfile mode error in config update Removed `delete=False, mode='w'` from `TemporaryDirectory` to fix incorrect usage that caused potential errors. Ensures temporary directory is properly cleaned up and simplifies the tempfile creation process. This update improves file handling and stability. --- update_local_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update_local_config.py b/update_local_config.py index 3bc88ac..2c30ca6 100644 --- a/update_local_config.py +++ b/update_local_config.py @@ -62,7 +62,7 @@ def main(): updated_content = replace_peer_section(config_content, new_peer_section) # Step 4: Save the updated configuration file - with tempfile.TemporaryDirectory(delete=False, mode='w') as tempdir: + with tempfile.TemporaryDirectory() as tempdir: temp_file = pathlib.Path(tempdir) / f"{interface}.conf" temp_file_path = str(temp_file)