From cca91e9dc942c57d61027089ef656fbc7366a071 Mon Sep 17 00:00:00 2001 From: mgomes-d <104273811+mgomes-d@users.noreply.github.com> Date: Tue, 18 Mar 2025 11:49:56 +0100 Subject: [PATCH] fix: the return value from the response is bytes. - Adjusted the download logic to process the file content directly as bytes. --- atlassian/confluence.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/atlassian/confluence.py b/atlassian/confluence.py index 6a3cb06db..9f0cb890a 100644 --- a/atlassian/confluence.py +++ b/atlassian/confluence.py @@ -1470,17 +1470,17 @@ def download_attachments_from_page(self, page_id, path=None, start=0, limit=50, file_name = attachment["title"] or attachment["id"] # Use attachment ID if title is unavailable download_link = self.url + attachment["_links"]["download"] # Fetch the file content - response = self.get(str(download_link)) + response = self.get(str(download_link), not_json_response=True) if to_memory: # Store in BytesIO object - file_obj = io.BytesIO(response.content) + file_obj = io.BytesIO(response) downloaded_files[file_name] = file_obj else: # Save file to disk file_path = os.path.join(path, file_name) with open(file_path, "wb") as file: - file.write(response.content) + file.write(response) # Return results based on storage mode if to_memory: