Island: Handle Path objects in open_new_securely_permissioned_file()

This commit is contained in:
Mike Salvatore 2021-11-18 14:22:07 -05:00
parent c3424b46bc
commit 796ae84be1
1 changed files with 2 additions and 1 deletions

View File

@ -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)