Skip to content

Missing context parameter in call_* methods of asyncio.events.AbstractEventLoop #93255

Closed
@d-maurer

Description

@d-maurer

asyncio.events.AbstractEventLoop defines its call_* methods via:

    def call_soon(self, callback, *args):
        return self.call_later(0, callback, *args)

    def call_later(self, delay, callback, *args):
        raise NotImplementedError

    def call_at(self, when, callback, *args):
        raise NotImplementedError

But futures.Future (e.g.) expects call_soon to have a context parameter:

    def __schedule_callbacks(self):
        ...
        for callback, ctx in callbacks:
            self._loop.call_soon(callback, self, context=ctx)

Seen in Python 3.9 through 3.11.

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.10only security fixes3.11only security fixes3.12only security fixestopic-asynciotype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions