Skip to content

asyncio.EventLoop.start_tls() returns None #105993

@Dreamsorcerer

Description

@Dreamsorcerer

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions