aiohttp: AttributeError: ‘NoneType‘ object has no attribute ‘get_extra_info‘

使用 Proxyman 分析 aiohttp 请求时遇到如上错误:

报错环境

  • 系统: mac
  • Python: Python 3.8.11
  • aiohttp: 3.8.0
  • 抓包软件: Proxyman

解决方案:

修改 ***/python3.8/site-packages/aiohttp/connector.py 1211 行:

# 注释如下行
# runtime_has_start_tls = self._loop_supports_start_tls()

# 新增
runtime_has_start_tls = False if req.proxy.scheme != "https" else self._loop_supports_start_tls()

参考

  • https://github.com/aio-libs/aiohttp/issues/6239#issuecomment-974676306
  • https://github.com/aio-libs/aiohttp/issues/6239#issuecomment-974670207

你可能感兴趣的:(Python,python,aiohttp,asyncio)