msg332934 - (view) |
Author: (skorpeo) |
Date: 2019-01-03 16:41 |
when testing example from https://docs.python.org/3/library/http.client.html. Specifically the chunked example, i.e. while not r1.closed. Results in infinite loop.
I believe this is because line 398 function def _close_conn(self), should call self.close().
|
msg332947 - (view) |
Author: Martin Panter (martin.panter) * |
Date: 2019-01-03 20:21 |
This was changed in Python 3.2+ in Issue 16723. The response object no longer sets the “closed” attribute when it runs out of data; it is only set when the “close” method is called. Perhaps the example should be amended so that it checks if “read” returned an empty string, rather than checking “closed”.
Another problem with the example is that printing the chunk as a bytes object can trigger BytesWarning. I would add a “repr” call to avoid that.
|
msg332950 - (view) |
Author: (skorpeo) |
Date: 2019-01-03 22:07 |
Ha, ok that would explain it. Yes, I think it would indeed be helpful to
update the example, but then again I guess leaving it as is may be a good
way to find out if people are reading the docs.
On Thu, Jan 3, 2019 at 10:21 PM Martin Panter <report@bugs.python.org>
wrote:
>
> Martin Panter <vadmium+py@gmail.com> added the comment:
>
> This was changed in Python 3.2+ in Issue 16723. The response object no
> longer sets the “closed” attribute when it runs out of data; it is only set
> when the “close” method is called. Perhaps the example should be amended so
> that it checks if “read” returned an empty string, rather than checking
> “closed”.
>
> Another problem with the example is that printing the chunk as a bytes
> object can trigger BytesWarning. I would add a “repr” call to avoid that.
>
> ----------
> assignee: -> docs@python
> components: +Documentation
> nosy: +docs@python, martin.panter
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue35649>
> _______________________________________
>
|
msg351843 - (view) |
Author: Julien Palard (mdk) * |
Date: 2019-09-11 12:41 |
New changeset 62cf6981425c6a6b136c5e2abef853364f535e9d by Julien Palard (Ashwin Ramaswami) in branch 'master':
bpo-35649: update http client example (GH-11441)
https://github.com/python/cpython/commit/62cf6981425c6a6b136c5e2abef853364f535e9d
|
msg351851 - (view) |
Author: Julien Palard (mdk) * |
Date: 2019-09-11 13:02 |
New changeset 43fb3bb223338511a7aee9b55d75af4a415134dc by Julien Palard (Miss Islington (bot)) in branch '3.8':
bpo-35649: update http client example (GH-11441) (GH-15930)
https://github.com/python/cpython/commit/43fb3bb223338511a7aee9b55d75af4a415134dc
|
msg351858 - (view) |
Author: Julien Palard (mdk) * |
Date: 2019-09-11 13:13 |
New changeset 0fd8c0560b2099d2c976b17cf01cb596badc1ec6 by Julien Palard (Miss Islington (bot)) in branch '3.7':
bpo-35649: update http client example (GH-11441) (GH-15931)
https://github.com/python/cpython/commit/0fd8c0560b2099d2c976b17cf01cb596badc1ec6
|
|
Date |
User |
Action |
Args |
2022-04-11 14:59:09 | admin | set | github: 79830 |
2019-09-11 13:14:19 | mdk | set | keywords:
patch, patch, patch, patch status: open -> closed resolution: fixed stage: patch review -> resolved |
2019-09-11 13:13:59 | mdk | set | messages:
+ msg351858 |
2019-09-11 13:02:28 | mdk | set | messages:
+ msg351851 |
2019-09-11 12:42:16 | miss-islington | set | pull_requests:
+ pull_request15570 |
2019-09-11 12:42:09 | miss-islington | set | pull_requests:
+ pull_request15569 |
2019-09-11 12:41:57 | mdk | set | nosy:
+ mdk messages:
+ msg351843
|
2019-01-06 01:09:48 | python-dev | set | keywords:
+ patch stage: patch review pull_requests:
+ pull_request10886 |
2019-01-06 01:09:41 | python-dev | set | keywords:
+ patch stage: (no value) pull_requests:
+ pull_request10887 |
2019-01-06 01:09:34 | python-dev | set | keywords:
+ patch stage: (no value) pull_requests:
+ pull_request10885 |
2019-01-06 01:09:28 | python-dev | set | keywords:
+ patch stage: (no value) pull_requests:
+ pull_request10884 |
2019-01-04 21:32:55 | terry.reedy | set | versions:
+ Python 3.8, - Python 3.5, Python 3.6 |
2019-01-03 22:07:33 | skorpeo | set | messages:
+ msg332950 title: http.client doesn't close. Infinite loop -> http.client doesn't close. Infinite loop |
2019-01-03 20:21:41 | martin.panter | set | nosy:
+ docs@python, martin.panter messages:
+ msg332947
assignee: docs@python components:
+ Documentation |
2019-01-03 16:45:41 | skorpeo | set | type: behavior |
2019-01-03 16:41:48 | skorpeo | create | |