lixi5338619 / asyncpy

使用asyncio和aiohttp开发的轻量级异步协程web爬虫框架
110 stars 27 forks source link

第一次尝试的小Bug #3

Closed Createitv closed 2 years ago

Createitv commented 3 years ago
[2021:09:05 17:46:21] INFO  demo Asyncpy finished spider: demo
[2021:09:05 17:46:21] INFO  demo Total requests: 1
[2021:09:05 17:46:21] INFO  demo Time usage: 0:00:00.463248
[2021:09:05 17:46:21] INFO  demo Spider finished!
Traceback (most recent call last):
  File "/Users/tnt/Desktop/demoA/demo/spiders/demo.py", line 19, in <module>
    DemoSpider.start()
  File "/Users/tnt/Documents/虚拟环境/asyncpy/lib/python3.9/site-packages/asyncpy/spider.py", line 410, in start
    spider_ins.loop.run_until_complete(
  File "uvloop/loop.pyx", line 1501, in uvloop.loop.Loop.run_until_complete
  File "/Users/tnt/Documents/虚拟环境/asyncpy/lib/python3.9/site-packages/asyncpy/spider.py", line 313, in _start
    await self.start_master()
  File "/Users/tnt/Documents/虚拟环境/asyncpy/lib/python3.9/site-packages/asyncpy/spider.py", line 553, in start_master
    await self.stop(SIGINT)
  File "/Users/tnt/Documents/虚拟环境/asyncpy/lib/python3.9/site-packages/asyncpy/spider.py", line 588, in stop
    await self._cancel_tasks()
  File "/Users/tnt/Documents/虚拟环境/asyncpy/lib/python3.9/site-packages/asyncpy/spider.py", line 206, in _cancel_tasks
    for task in asyncio.Task.all_tasks():
AttributeError: type object '_asyncio.Task' has no attribute 'all_tasks'
Createitv commented 3 years ago

asyncio.Task.all_tasks() => asyncio.all_tasks() shrimpy-dev/shrimpy-python#10

lixi5338619 commented 3 years ago

收到,麻烦提供一下当前运行环境,我这边测试一下。