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
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.
The text was updated successfully, but these errors were encountered:
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.
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 returnsTrue
. But in this case, my stream object returnsFalse
on the call. This is unexpected, because I can callread()
and get data -- which seems wrong becauseFalse
meansread()
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.
The text was updated successfully, but these errors were encountered: