Issue13464
Created on 2011-11-23 18:13 by r.david.murray, last changed 2022-04-11 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue13464.patch | Jon.Kuhn, 2011-12-04 04:36 | Patch based on 06087f6890af | review | |
| issue13464_r1.patch | Jon.Kuhn, 2011-12-04 16:54 | Updated Patch | review | |
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 22737 | fbidu, 2020-10-23 19:09 | ||
| Messages (7) | |||
|---|---|---|---|
| msg148199 - (view) | Author: R. David Murray (r.david.murray) * ![]() |
Date: 2011-11-23 18:13 | |
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. |
|||
| msg148837 - (view) | Author: Jon Kuhn (Jon.Kuhn) * | Date: 2011-12-04 04:36 | |
This is my first contribution to a real open source project. Attached is my patch. Suggestions for improvements are welcome. |
|||
| msg148846 - (view) | Author: Antoine Pitrou (pitrou) * ![]() |
Date: 2011-12-04 09:20 | |
Hello Jon, and thanks for the patch. I have a couple of comments: - readinto() shouldn't return None but 0 when there is nothing to read (this corresponds to read() returning b"") - I see _read_chunked() is only ever called with amt=None, so perhaps it can be simplified? Also, a nitpick: the doc entry needs a "versionadded" tag. |
|||
| msg148852 - (view) | Author: Jon Kuhn (Jon.Kuhn) * | Date: 2011-12-04 16:54 | |
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. |
|||
| msg148939 - (view) | Author: Roundup Robot (python-dev) ![]() |
Date: 2011-12-06 21:39 | |
New changeset 806cfe39f729 by Antoine Pitrou in branch 'default': Issue #13464: Add a readinto() method to http.client.HTTPResponse. http://hg.python.org/cpython/rev/806cfe39f729 |
|||
| msg148940 - (view) | Author: Antoine Pitrou (pitrou) * ![]() |
Date: 2011-12-06 21:41 | |
Ok, thank you. I've now committed the patch in the default branch. Congratulations! (since the documentation doesn't claim that HTTPResponse implements RawIOBase, I tend to consider this a feature request rather than a bugfix, hence no 3.2 commit) |
|||
| msg150627 - (view) | Author: Roundup Robot (python-dev) ![]() |
Date: 2012-01-04 17:58 | |
New changeset 4b21f651eeee by Antoine Pitrou in branch 'default': Issue #13713: fix a regression in HTTP chunked reading after 806cfe39f729 http://hg.python.org/cpython/rev/4b21f651eeee |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:57:24 | admin | set | github: 57673 |
| 2020-10-23 19:09:49 | fbidu | set | nosy:
+ fbidu pull_requests: + pull_request21847 |
| 2012-01-04 17:58:37 | python-dev | set | messages: + msg150627 |
| 2011-12-06 21:41:39 | pitrou | set | status: open -> closed versions: - Python 3.2 type: behavior -> enhancement messages: + msg148940 resolution: fixed |
| 2011-12-06 21:39:54 | python-dev | set | nosy:
+ python-dev messages: + msg148939 |
| 2011-12-04 16:54:48 | Jon.Kuhn | set | files:
+ issue13464_r1.patch messages: + msg148852 |
| 2011-12-04 09:20:47 | pitrou | set | messages:
+ msg148846 stage: patch review |
| 2011-12-04 04:36:11 | Jon.Kuhn | set | files:
+ issue13464.patch nosy:
+ Jon.Kuhn keywords: + patch |
| 2011-11-23 18:13:58 | r.david.murray | create | |

