-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
Description
Bug report
The documentation says the function should return a transport:
https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.start_tls
But, in some cases it actually returns None. It looks like this may happen when it receives a closing transport:
aio-libs/aiohttp#3355 (comment)
I suspect this is because connection_lost() gets called during the start_tls() call, which ends up setting it to None:
cpython/Lib/asyncio/sslproto.py
Line 412 in dba7217
self._app_transport = None |
Should this be allowed to return None, or should there be an exception occurring here?
A simple change could be to check for None and raise an exception, but I'm not too familiar with how this part of the code is expected to work.
Linked PRs
- gh-105993: Add possible None return type to start_tls() docs #105995
- [3.12] gh-105993: Add possible
None
return type toasyncio.EventLoop.start_tls
docs (GH-105995) #106188 - [3.11] gh-105993: Add possible
None
return type toasyncio.EventLoop.start_tls
docs (GH-105995) #106189 - [3.10] gh-105993: Add possible
None
return type toasyncio.EventLoop.start_tls
docs (GH-105995) #106190
Metadata
Metadata
Assignees
Labels
Projects
Status
Done