Skip to content

Bad data type in update_body_from_data #1306

Closed
@demmsnt

Description

https://github.com/KeepSafe/aiohttp/blob/master/aiohttp/client_reqrep.py#L260

i see elif not self.chunked and isinstance(data, io.BufferedReader):

But using aiobotocore i try

    resp = yield from client.put_object(Bucket=bucket,
                                        Key=key,
                                        Body=open('ANONYMIZE.zip', 'r+b'))

Type of Body is io.BufferedRandom

I replace code to

elif not self.chunked and (isinstance(data, io.BufferedReader) or isinstance(data, io.BufferedRandom)):

And that fix problem.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions