Q:

python 3.7.5: asyncio.get_event_loop did not create event loop

My main python thread does not use asyncio, but it creates a new thread whose code uses asyncio, where it encountered an error when calling get_event_loop():
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/hanxu/work/thunderrock/node_server/quic/udp_async.py", line 33, in udp_async
    loop = asyncio.get_event_loop()
  File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/events.py", line 644, in get_event_loop
    % threading.current_thread().name)
RuntimeError: There is no current event loop in thread 'Thread-5'. 

Per online document of Python 3.7, get_event_loop should automatically create a new event loop if no existing yet.  Why does it fail in this case?   Is it because of threading? 
Btw I am doing the following to workaround, but still wondering why the issue existed: 
    try:
        loop = asyncio.get_event_loop()
    except RuntimeError:
        loop = asyncio.new_event_loop()
        asyncio.set_event_loop(loop)

A:

Thanks for the question. 
The documentation is slightly incorrect, new even loop is implicitly created only for the main thread. 
Please track https://bugs.python.org/issue39381 for the fix.