
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2017-03-06 22:35 byfafhrd91, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 494 | fafhrd91,2017-03-06 22:35 | ||
| PR 525 | merged | fafhrd91,2017-03-06 23:36 | |
| PR 645 | merged | yselivanov,2017-03-12 19:29 | |
| PR 646 | merged | yselivanov,2017-03-12 19:30 | |
| PR 703 | larry,2017-03-17 21:00 | ||
| Messages (8) | |||
|---|---|---|---|
| msg289138 -(view) | Author: Nikolay Kim (fafhrd91)* | Date: 2017-03-06 22:35 | |
https://github.com/python/asyncio/issues/494 | |||
| msg289139 -(view) | Author: Nikolay Kim (fafhrd91)* | Date: 2017-03-06 22:37 | |
exception on get_extra_info() on closed ssl transport```Feb 18 13:18:09 btc electrumx_server.py[1732]: ERROR:ElectrumX:[15328] Traceback (most recent call last):Feb 18 13:18:09 btc electrumx_server.py[1732]: File "/usr/local/lib/python3.5/dist-packages/electrumx-0.11.1-py3.5.egg/lib/jsonrpc.py", line 528, in process_single_requestFeb 18 13:18:09 btc electrumx_server.py[1732]: result = await self.handle_payload(payload, self.request_handler)Feb 18 13:18:09 btc electrumx_server.py[1732]: File "/usr/local/lib/python3.5/dist-packages/electrumx-0.11.1-py3.5.egg/lib/jsonrpc.py", line 608, in handle_payloadFeb 18 13:18:09 btc electrumx_server.py[1732]: return await handler(**kw_args)Feb 18 13:18:09 btc electrumx_server.py[1732]: File "/usr/local/lib/python3.5/dist-packages/electrumx-0.11.1-py3.5.egg/server/session.py", line 282, in bannerFeb 18 13:18:09 btc electrumx_server.py[1732]: if self.is_tor():Feb 18 13:18:09 btc electrumx_server.py[1732]: File "/usr/local/lib/python3.5/dist-packages/electrumx-0.11.1-py3.5.egg/server/session.py", line 259, in is_torFeb 18 13:18:09 btc electrumx_server.py[1732]: peer_info = self.peer_info()Feb 18 13:18:09 btc electrumx_server.py[1732]: File "/usr/local/lib/python3.5/dist-packages/electrumx-0.11.1-py3.5.egg/lib/jsonrpc.py", line 764, in peer_infoFeb 18 13:18:09 btc electrumx_server.py[1732]: return self.transport.get_extra_info('peername')Feb 18 13:18:09 btc electrumx_server.py[1732]: File "/usr/lib/python3.5/asyncio/sslproto.py", line 306, in get_extra_infoFeb 18 13:18:09 btc electrumx_server.py[1732]: return self._ssl_protocol._get_extra_info(name, default)Feb 18 13:18:09 btc electrumx_server.py[1732]: File "/usr/lib/python3.5/asyncio/sslproto.py", line 537, in _get_extra_infoFeb 18 13:18:09 btc electrumx_server.py[1732]: return self._transport.get_extra_info(name, default)Feb 18 13:18:09 btc electrumx_server.py[1732]: AttributeError: 'NoneType' object has no attribute 'get_extra_info'``` | |||
| msg289140 -(view) | Author: R. David Murray (r.david.murray)*![]() | Date: 2017-03-06 22:44 | |
Thanks for the report and PR, but your fix is not obviously correct. In general exceptions are the way in Python that errors are reported, and asking for extra_info on a closed stream is an error. The exception raised is not clear, so perhaps the asyncio folks will want to improve it. Or perhaps I'm wrong and they will want to return None, but I'll be a bit surprised if that is the case :) | |||
| msg289141 -(view) | Author: Nikolay Kim (fafhrd91)* | Date: 2017-03-06 22:49 | |
get_extra_info() returns optional transport information, I think it is ok to return None for closed transport.https://github.com/python/cpython/blob/master/Lib/asyncio/transports.py#L18I propose this feature initially, during early tulip developmentbut now I think it is not good api. | |||
| msg289142 -(view) | Author: Yury Selivanov (yselivanov)*![]() | Date: 2017-03-06 22:50 | |
> Thanks for the report and PR, but your fix is not obviously correct. Not for this particular asyncio method though, see asyncio PEP [1]. But there's an actual bug in the PR, instead of returning `None` we should return `default`.[1]https://www.python.org/dev/peps/pep-3156/#methods-for-all-transports | |||
| msg290192 -(view) | Author: Yury Selivanov (yselivanov)*![]() | Date: 2017-03-24 22:21 | |
New changesetdb522dc86294a99f46a63cd5b54c7c4ab8017c96 by Yury Selivanov in branch '3.5':bpo-29742: asyncio get_extra_info() throws exception (#525) (#646)https://github.com/python/cpython/commit/db522dc86294a99f46a63cd5b54c7c4ab8017c96 | |||
| msg290193 -(view) | Author: Yury Selivanov (yselivanov)*![]() | Date: 2017-03-24 22:21 | |
New changeset99f8d33a94c8951fd6b2d5f079d20be698150993 by Yury Selivanov in branch '3.6':bpo-29742: asyncio get_extra_info() throws exception (#525) (#645)https://github.com/python/cpython/commit/99f8d33a94c8951fd6b2d5f079d20be698150993 | |||
| msg290196 -(view) | Author: Yury Selivanov (yselivanov)*![]() | Date: 2017-03-24 22:21 | |
New changeset2b27e2e6a35c3d3e369612b984017fe0d1bfcf0c by Yury Selivanov (Nikolay Kim) in branch 'master':bpo-29742: asyncio get_extra_info() throws exception (#525)https://github.com/python/cpython/commit/2b27e2e6a35c3d3e369612b984017fe0d1bfcf0c | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:43 | admin | set | github: 73928 |
| 2017-03-24 22:21:52 | yselivanov | set | messages: +msg290196 |
| 2017-03-24 22:21:26 | yselivanov | set | messages: +msg290193 |
| 2017-03-24 22:21:21 | yselivanov | set | messages: +msg290192 |
| 2017-03-17 21:00:33 | larry | set | pull_requests: +pull_request596 |
| 2017-03-12 21:06:52 | yselivanov | set | status: open -> closed resolution: fixed stage: resolved |
| 2017-03-12 19:30:20 | yselivanov | set | pull_requests: +pull_request535 |
| 2017-03-12 19:29:56 | yselivanov | set | pull_requests: +pull_request534 |
| 2017-03-06 23:40:52 | gvanrossum | set | nosy: -gvanrossum |
| 2017-03-06 23:36:42 | fafhrd91 | set | pull_requests: +pull_request438 |
| 2017-03-06 22:50:39 | yselivanov | set | messages: +msg289142 |
| 2017-03-06 22:49:12 | fafhrd91 | set | messages: +msg289141 |
| 2017-03-06 22:44:24 | r.david.murray | set | nosy: +r.david.murray,gvanrossum,yselivanov messages: +msg289140 components: + asyncio |
| 2017-03-06 22:37:31 | fafhrd91 | set | messages: +msg289139 |
| 2017-03-06 22:35:43 | fafhrd91 | create | |