Skip to content

How do I use a long-lived ClientSession? #7570

Answered by Dreamsorcerer
the-vindicar asked this question in Q&A
Discussion options

You must be logged in to vote

Ah, Windows. Yes, that bug should be fixed in aiohttp 4, which is not released.

However, maybe you should also report a bug to cpython. As you can see in the traceback, aiohttp is nowhere in the traceback, so asyncio is causing the exception, not us:

Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x0000017FAC405048>
Traceback (most recent call last):
  File "C:\Programs\Python37\lib\asyncio\proactor_events.py", line 95, in __del__
    self.close()
  File "C:\Programs\Python37\lib\asyncio\proactor_events.py", line 86, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Programs\Python37\lib\asyncio\base_events.py", line 683, in call_soon
  …

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@the-vindicar
Comment options

@the-vindicar
Comment options

@Dreamsorcerer
Comment options

Answer selected by the-vindicar
@BabakAmini
Comment options

@Dreamsorcerer
Comment options

@BabakAmini
Comment options

@Dreamsorcerer
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants