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
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee=Noneclosed_at=<Date2011-12-06.21:41:39.277>created_at=<Date2011-11-23.18:13:58.798>labels= ['easy', 'type-feature', 'library']
title='HTTPResponse is missing an implementation of readinto'updated_at=<Date2020-10-23.19:09:49.240>user='https://github.com/bitdancer'
HTTPResponse subclasses RawIOBase, but does not provide an implementation of readinto, only read. This means that it is not conforming to the IO spec, and so it cannot be wrapped in a BufferedIOBase when using the C version of io.
Thanks for the comments. Attached is an updated patch.
In the RawIOBase docs it says "If the object is in non-blocking mode and no bytes are available, None is returned." So I wasn't sure if that meant any time no bytes were available or just when no bytes are available and EOF has not been reached. -- I updated it to return 0 instead of None.
I simplified _read_chunked() and renamed it to _readall_chunked() since that is all it does.
I added the versionadded tag specifying that it was added in 3.3 since the patch is for the default branch.