From a5cd9a46169cecfa8908c8ce88ac91963a8b8258 Mon Sep 17 00:00:00 2001 From: HarlodHolt <67050609+HarlodHolt@users.noreply.github.com> Date: Sat, 10 Feb 2024 08:01:07 +1100 Subject: [PATCH] Fix issue #12 byte-based instead of text based --- git_connector.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git_connector.py b/git_connector.py index deb6a5b..b5b7454 100644 --- a/git_connector.py +++ b/git_connector.py @@ -252,7 +252,7 @@ def _file_interaction(self, action_result, action, file_path, contents='', vault try: vault_file_path = Path(list(vault_file_info)[0].get('path')) - vault_file_data = vault_file_path.read_text() + vault_file_data = vault_file_path.read_bytes() except Exception as e: self.debug_print(f'Exception : {e}') return action_result.set_status(phantom.APP_ERROR) @@ -268,7 +268,7 @@ def _file_interaction(self, action_result, action, file_path, contents='', vault full_path.parent.mkdir(parents=True, exist_ok=True) # overwrite file into local disk - full_path.write_text(file_data) + full_path.write_bytes(file_data) # add into index repo.index.add(file_path)