s3transfer icon indicating copy to clipboard operation
s3transfer copied to clipboard

Subclass bytes to support the Buffer API

Open dstufft opened this issue 7 years ago • 3 comments

dstufft avatar Jul 05 '17 23:07 dstufft

Not sure what to make of the travis failures, any ideas?

jamesls avatar Jul 05 '17 23:07 jamesls

I'm not sure, I'm poking at it but it appears the event handler that is being registered by TransferManager isn't getting called at all.

dstufft avatar Jul 05 '17 23:07 dstufft

FWIW, I think the failure had to do with CallbackEnablingBody always being a False-y value, meaning that when we'd prepare the request, we'd pass a None body to requests. See https://github.com/boto/botocore/blob/@{2017-07-05}/botocore/vendored/requests/models.py#L455 -- since data is False-y, body stays None.

Even with modern botocore (which has its own request-preparer, no longer vendors requests, etc.) the body == b'' check in AWSRequestPreparer._prepare_body (see https://github.com/boto/botocore/blob/1.12.26/botocore/awsrequest.py#L411-L412, for example) would cause the same behavior.

Regardless, pretty sure this got addressed by #91, when CallbackEnablingBody started subclassing RawIOBase -- I think this PR can be closed.

tipabu avatar Oct 18 '18 00:10 tipabu