From 0bbaeaad27e59b3a3cf17a2b876fb997ee0002f6 Mon Sep 17 00:00:00 2001 From: Dima Unterov Date: Sun, 11 May 2025 17:19:57 +0100 Subject: [PATCH] fix: method attach_file() to not read() file content and simply pass to attach_content() --- atlassian/confluence.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/atlassian/confluence.py b/atlassian/confluence.py index 4e455b3bd..e2f856b3e 100644 --- a/atlassian/confluence.py +++ b/atlassian/confluence.py @@ -1502,16 +1502,15 @@ def attach_file( content_type = self.content_types.get(extension, "application/binary") with open(filename, "rb") as infile: - content = infile.read() - return self.attach_content( - content, - name, - content_type, - page_id=page_id, - title=title, - space=space, - comment=comment, - ) + return self.attach_content( + infile, + name, + content_type, + page_id=page_id, + title=title, + space=space, + comment=comment, + ) def download_attachments_from_page(self, page_id, path=None, start=0, limit=50, filename=None, to_memory=False): """