Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readable() from File Object from aws_encryption_sdk.stream always False #73

Closed
Redoubts opened this issue Aug 29, 2018 · 2 comments
Closed
Assignees
Labels

Comments

@Redoubts
Copy link

I'm trying to upload a file to an S3 bucket with boto3's upload_fileobj. I wanted to create an StreamEncryptor so that I could chain together the encryption and upload without much copying. But I find that the StreamEncryptor object won't take because it's not compatible.

Compatibility means calling readable() on the object if it exists, and ensuring it returns True. But in this case, my stream object returns False on the call. This is unexpected, because I can call read() and get data -- which seems wrong because False means read() should raise an error.

I can't see where readable is implemented in this class, it seems deep in the base/meta class. But maybe it's not implemented at all and defaulting to this value. But I think it should either return a semantically correct value, or not have this function at all.

@mattsb42-aws
Copy link
Member

Good catch. We had just been inheriting that from io.IOBase, which is why you couldn't find it, but it looks like we were not testing what that behavior actually did.

@mattsb42-aws
Copy link
Member

This fix is now available in version 1.3.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants