Skip to content

Commit

Permalink
Fix IO error
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit74 committed Dec 1, 2024
1 parent 0ba35d5 commit e0b8b01
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scraper/src/mindtouch2zim/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,13 @@ def _get_image_content(
if CONTEXT.s3_url_with_credentials:
# upload optimized to S3
logger.debug("Uploading to S3")
self._upload_to_s3_cache(s3_key=s3_key, meta=meta, asset_content=optimized)
self._upload_to_s3_cache(
s3_key=s3_key,
meta=meta,
asset_content=BytesIO(
optimized.getvalue()
), # use a copy because it will be "consumed" by botocore
)

return optimized

Expand Down

0 comments on commit e0b8b01

Please sign in to comment.