Skip to content

DecryptionStream should handle simplest FileObj #80

Closed
@Redoubts

Description

@Redoubts

So I'm trying to stream a download into a decryption stream, and my code looks something like this:

downloadable = self.bucket.Object(key).get()
destination = open(path_to_file, "wb")

decrypted_data = aws_encryption_sdk.stream(
            mode='d',
            source=downloadable["Body"],
            key_provider=self.static_master_key_provider
)

for chunk in decrypted_data:
    destination.write(chunk)

When I do this, I get an error after a single successful chunk read:
AttributeError: 'StreamingBody' object has no attribute 'closed'
I think it should try and handle this case (object with nothing but read and close).

Unless you think this is an inappropriate way of piping an s3 blob into the decryption streamer.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions