Default AsyncBaseStream to abort closed SSL transports
authorHarmon <Harmon758@gmail.com>
Sat, 29 Oct 2022 03:14:50 +0000 (22:14 -0500)
committerHarmon <Harmon758@gmail.com>
Sat, 29 Oct 2022 03:15:17 +0000 (22:15 -0500)
Resolves #1904

tweepy/asynchronous/streaming.py

index 0a943f2f0a8a4296deab62fd760d69a43e0bc925..c413a534622fa7e819e58ba9ce9c4dff3f5c78a7 100644 (file)
@@ -53,6 +53,7 @@ class AsyncBaseStream:
 
         if self.session is None or self.session.closed:
             self.session = aiohttp.ClientSession(
+                connector=aiohttp.TCPConnector(enable_cleanup_closed=True),
                 timeout=aiohttp.ClientTimeout(sock_read=timeout)
             )
         self.session.headers["User-Agent"] = self.user_agent