Skip to content

Commit

Permalink
Merge pull request #2063 from kesara/fix/attachment-hash
Browse files Browse the repository at this point in the history
Get correct checksum for attachments
  • Loading branch information
liZe committed Feb 12, 2024
2 parents 8aecf38 + 5d95ed4 commit f85a09e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion weasyprint/pdf/anchors.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def write_pdf_attachment(pdf, attachment, compress):
except URLFetchingError as exception:
LOGGER.error('Failed to load attachment: %s', exception)
return
attachment.md5 = hashlib.md5(data).hexdigest()
attachment.md5 = hashlib.md5(stream).hexdigest()

# TODO: Use the result object from a URL fetch operation to provide more
# details on the possible filename and MIME type.
Expand Down

0 comments on commit f85a09e

Please sign in to comment.