RuntimeError: File descriptor 8 is used by transport
问题 Minimal demonstration example: import asyncio async def main(): c1_reader, c1_writer = await asyncio.open_connection(host='google.com', port=80) c1_socket = c1_writer.get_extra_info('socket') c1_socket.close() c2_reader, c2_writer = await asyncio.open_connection(host='google.com', port=80) asyncio.run(main()) Running this program gives this error: $ python3 asyncio_fd_used.py Traceback (most recent call last): File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7