From 796ae84be172eb048c12f43f1f51754f4633526f Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Thu, 18 Nov 2021 14:22:07 -0500 Subject: [PATCH] Island: Handle Path objects in open_new_securely_permissioned_file() --- monkey/monkey_island/cc/server_utils/file_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/monkey/monkey_island/cc/server_utils/file_utils.py b/monkey/monkey_island/cc/server_utils/file_utils.py index f7fe77cc3..3371d5acb 100644 --- a/monkey/monkey_island/cc/server_utils/file_utils.py +++ b/monkey/monkey_island/cc/server_utils/file_utils.py @@ -55,7 +55,8 @@ def _create_secure_directory_windows(path: str): @contextmanager def open_new_securely_permissioned_file(path: str, mode: str = "w") -> Generator: if is_windows_os(): - fd = _get_file_descriptor_for_new_secure_file_windows(path) + # TODO: Switch from string to Path object to avoid this hack. + fd = _get_file_descriptor_for_new_secure_file_windows(str(path)) else: fd = _get_file_descriptor_for_new_secure_file_linux(path)