You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: S3Object.closed is False after close() for gzip, and makes S3 calls for zip #8564
After S3Object.close(), S3Object.closed is True. Checking closed does not do any work against S3.
Current Behaviour
S3Object.closed is implemented as self.transformed_stream.closed, and transformed_stream is created lazily. That has two side effects:
For an object that was never read, close() only closes the raw stream. A later .closed then builds the transformed stream on top of the already closed raw stream. With is_gzip=True it returns False for an object that was just closed.
With a transformation that reads on creation, checking .closed issues S3 requests. ZipTransform reads the archive's central directory, so .closed calls HeadObject and GetObject.
For the zip case, use a botocore Stubber with no queued responses: obj.transform(ZipTransform(), in_place=True); obj.closed raises UnStubbedResponseError for HeadObject.
Possible Solution
When the transformed stream has not been created yet, answer from the raw stream (self.raw_stream.closed) instead of creating it. I have a small fix with tests ready.
Disclosure: I found this while reviewing the streaming utility with the help of an AI assistant (Claude Code). I ran the snippets above myself against develop.
Thanks for opening your first issue here! We'll come back to you as soon as we can.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link
This issue is now closed. Please be mindful that future comments are hard for our team to see.
If you need more assistance, please either reopen the issue, or open a new issue referencing this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Activity
boring-cyborg commentedon Oct 16, 2026
Thanks for opening your first issue here! We'll come back to you as soon as we can.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link
powertools-for-aws-oss-automation commentedon Oct 16, 2026
Warning
This issue is now closed. Please be mindful that future comments are hard for our team to see.
If you need more assistance, please either reopen the issue, or open a new issue referencing this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
github-actions commentedon Oct 22, 2026
This is now released under 3.37.0 version!