{"record":{"id":"e6f58ff78d6426e8","repo":"python/cpython","slug":"an-asyncio-future-a-coroutine-or-an-awaitable-is","errorCode":null,"errorMessage":"An asyncio.Future, a coroutine or an awaitable is required","messagePattern":"An asyncio\\.Future, a coroutine or an awaitable is required","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"Lib/asyncio/runners.py","lineNumber":104,"sourceCode":"        return self._loop\n\n    def run(self, coro, *, context=None):\n        \"\"\"Run code in the embedded event loop.\"\"\"\n        if events._get_running_loop() is not None:\n            # fail fast with short traceback\n            raise RuntimeError(\n                \"Runner.run() cannot be called from a running event loop\")\n\n        self._lazy_init()\n\n        if not coroutines.iscoroutine(coro):\n            if inspect.isawaitable(coro):\n                async def _wrap_awaitable(awaitable):\n                    return await awaitable\n\n                coro = _wrap_awaitable(coro)\n            else:\n                raise TypeError('An asyncio.Future, a coroutine or an '\n                                'awaitable is required')\n\n        if context is None:\n            context = self._context\n\n        task = self._loop.create_task(coro, context=context)\n\n        if (threading.current_thread() is threading.main_thread()\n            and signal.getsignal(signal.SIGINT) is signal.default_int_handler\n        ):\n            sigint_handler = functools.partial(self._on_sigint, main_task=task)\n            try:\n                signal.signal(signal.SIGINT, sigint_handler)\n            except ValueError:\n                # `signal.signal` may throw if `threading.main_thread` does\n                # not support signals (e.g. embedded interpreter with signals\n                # not registered - see gh-91880)\n                sigint_handler = None","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/python/cpython/blob/bc6749cc3b5ae4a5e88a6cc2d5b3bebbe354eae6/Lib/asyncio/runners.py#L86-L122","documentation":"Error \"An asyncio.Future, a coroutine or an awaitable is required\" thrown in python/cpython.","triggerScenarios":"Raised when Runner.run() is given something that is not a Future, coroutine, or awaitable.","commonSituations":"See trigger scenarios.","solutions":["Pass a coroutine, Future, or other awaitable to Runner.run(); verify the argument is the result of calling an async function, not the function itself or a non-awaitable value."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bc6749cc3b5ae4a5e88a6cc2d5b3bebbe354eae6","analyzedAt":"2026-08-14T22:01:13.976Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}