python / asyncio

asyncio historical repository
https://docs.python.org/3/library/asyncio.html
1.03k stars 178 forks source link

NameError in sslproto.py on _fatal_error. #482

Closed AraHaan closed 7 years ago

AraHaan commented 7 years ago

This is the Traceback that is shown when this NameError happens:

Exception ignored in: <bound method _SSLProtocolTransport.__del__ of <asyncio.sslproto._SSLProtocolTransport object at 0x03D80230>>
Traceback (most recent call last):
  File "asyncio\sslproto.py", line 328, in __del__
  File "asyncio\sslproto.py", line 319, in close
  File "asyncio\sslproto.py", line 542, in _start_shutdown
  File "asyncio\sslproto.py", line 547, in _write_appdata
  File "asyncio\sslproto.py", line 651, in _process_write_backlog
  File "asyncio\sslproto.py", line 658, in _fatal_error
NameError: name 'base_events' is not defined

Affected Python versions: 3.4.2, 3.4.3, 3.4.4, 3.4.5, 3.5.0, 3.5.1, 3.5.2, 3.6.0, and 3.7 (dev.)

Hopefully this gets fixed as this is an issue when using the version from the standard library. It is all the original asyncio as well.

For extra debugging if needed here is all of the output from the console (in case it is desired):

Creating a client session outside of coroutine
client_session: <aiohttp.client.ClientSession object at 0x03202E90>
Logged in as DecoraterBot
Bot id=104976661711179776
Discord.py v0.16.0 Async
-------------------------
Unclosed connector
connections: ['[(<asyncio.sslproto._SSLProtocolTransport object at 0x03D80230>,
<aiohttp.parsers.StreamProtocol object at 0x03F4D890>, 1448471.888)]']
connector: <aiohttp.connector.TCPConnector object at 0x03202EB0>
Task exception was never retrieved
future: <Task finished coro=<WebSocketCommonProtocol.run() done, defined at webs
ockets\protocol.py:407> exception=ConnectionResetError(10054, 'An existing conne
ction was forcibly closed by the remote host', None, 10054, None)>
Traceback (most recent call last):
  File "asyncio\tasks.py", line 241, in _step
  File "websockets\protocol.py", line 413, in run
  File "websockets\protocol.py", line 435, in read_message
  File "websockets\protocol.py", line 490, in read_data_frame
  File "websockets\protocol.py", line 525, in read_frame
  File "websockets\framing.py", line 80, in read_frame
  File "asyncio\streams.py", line 670, in readexactly
  File "asyncio\streams.py", line 627, in read
  File "asyncio\streams.py", line 457, in _wait_for_data
  File "asyncio\futures.py", line 361, in __iter__
  File "asyncio\tasks.py", line 296, in _wakeup
  File "asyncio\futures.py", line 274, in result
  File "asyncio\selector_events.py", line 669, in _read_ready
ConnectionResetError: [WinError 10054] An existing connection was forcibly close
d by the remote host
Fatal write error on socket transport
protocol: <asyncio.sslproto.SSLProtocol object at 0x03D800D0>
transport: <_SelectorSocketTransport fd=788>
Traceback (most recent call last):
  File "asyncio\selector_events.py", line 707, in write
OSError: [WinError 10038] An operation was attempted on something that is not a
socket
Exception ignored in: <bound method _SSLProtocolTransport.__del__ of <asyncio.ss
lproto._SSLProtocolTransport object at 0x03D80230>>
Traceback (most recent call last):
  File "asyncio\sslproto.py", line 328, in __del__
  File "asyncio\sslproto.py", line 319, in close
  File "asyncio\sslproto.py", line 542, in _start_shutdown
  File "asyncio\sslproto.py", line 547, in _write_appdata
  File "asyncio\sslproto.py", line 651, in _process_write_backlog
  File "asyncio\sslproto.py", line 658, in _fatal_error
NameError: name 'base_events' is not defined
Press any key to continue . . .
gvanrossum commented 7 years ago

This seems a duplicate of #363, should already have been fixed by #364. What version of asyncio or Python are you using?

AraHaan commented 7 years ago

Currently 3.5.2. Due to the fact of trying to read ZipExtImporter so I could make use of my own import machinery for when the files my import hook supports would also be importable from zip files. If I can do it then I will not have to worry about not being able to load up some files I want loaded from zip files. Unless I can read an pure python implementation of the zipimporter class.

gvanrossum commented 7 years ago

OK, it should be fixed in 3.5.3 -- can you install the rc1 for 3.5.3 and test?

AraHaan commented 7 years ago

I can try it.