python/asyncio

asyncio get_extra_info() throws exception (Python 3.5.3)

kyuupichan opened this issue · 3 comments

Here's a traceback. Note that the error is in asyncio's own code. This is an outgoing SSL connection made with asyncio's loop.create_connection or socket.open_connection (I use both; I don't know which created the outgoing connection in this instance) . Incoming SSL connections don't seem to have this issue.

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_request
Feb 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_payload
Feb 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 banner
Feb 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_tor
Feb 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_info
Feb 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_info
Feb 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_info
Feb 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'

1st1 commented

@fafhrd91 Maybe you can take a look at this one too? (since you're already working in sslproto.py)

sure