Skip to content

Can't pass an object with read() to StreamDecryptor #75

@Redoubts

Description

@Redoubts

So now I'm trying to download an encrypted file, and I figured I'd pipe it through the StreamDecryptor. But when I try this, I get back

TypeError: 'StreamingBody' does not have the buffer interface

I suspect this is because in def prep_stream_data(data): (L138:internal/utils/__init__.py), my file like object is checked with isinstance(data, (file, io.IOBase, six.StringIO)). But my object is a botocore StreamingBody, which doesn't inherit from any of these. So my object gets passed to io.BytesIO and dies because it's a stream and not a buffer.

I'm not sure what this check is specifically requiring, it might be nicer to check for specific methods -- I expected anything with read() to work here.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions