Python asyncio/aiohttp: ValueError: too many file descriptors in select() on Windows

错误描述

下面是我的部分代码:

tasks = [asyncio.ensure_future(run(url)) for url in url_list]
loop.run_until_complete(asyncio.wait(tasks))

下面是错误:

ValueError: too many file descriptors in select()。

分析

By default Windows can use only 64 sockets in asyncio loop. This is a limitation of underlying select() API call.

在Windows下,假如你的并发达到64个,程序会报错,这是受限于select()这个API的。

猜你喜欢

转载自blog.csdn.net/dta0502/article/details/83547654