to_attachment_dict() does not return the file's content of the Attachment object it was passed. Instead it returns the URI to the resource. To get the contents attachment.get() needs to be called.
https://jira.readthedocs.io/en/master/examples.html#attachments