{"record":{"id":"ee2df532dd9a1c72","repo":"python/cpython","slug":"when-cannot-be-none","errorCode":null,"errorMessage":"when cannot be None","messagePattern":"when cannot be None","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"Lib/asyncio/base_events.py","lineNumber":811,"sourceCode":"\n        Any positional arguments after the callback will be passed to\n        the callback when it is called.\n        \"\"\"\n        if delay is None:\n            raise TypeError('delay must not be None')\n        timer = self.call_at(self.time() + delay, callback, *args,\n                             context=context)\n        if timer._source_traceback:\n            del timer._source_traceback[-1]\n        return timer\n\n    def call_at(self, when, callback, *args, context=None):\n        \"\"\"Like call_later(), but uses an absolute time.\n\n        Absolute time corresponds to the event loop's time() method.\n        \"\"\"\n        if when is None:\n            raise TypeError(\"when cannot be None\")\n        self._check_closed()\n        if self._debug:\n            self._check_thread()\n            self._check_callback(callback, 'call_at')\n        timer = events.TimerHandle(when, callback, args, self, context)\n        if timer._source_traceback:\n            del timer._source_traceback[-1]\n        heapq.heappush(self._scheduled, timer)\n        timer._scheduled = True\n        return timer\n\n    def call_soon(self, callback, *args, context=None):\n        \"\"\"Arrange for a callback to be called as soon as possible.\n\n        This operates as a FIFO queue: callbacks are called in the\n        order in which they are registered.  Each callback will be\n        called exactly once.\n","sourceCodeStart":793,"sourceCodeEnd":829,"githubUrl":"https://github.com/python/cpython/blob/bc6749cc3b5ae4a5e88a6cc2d5b3bebbe354eae6/Lib/asyncio/base_events.py#L793-L829","documentation":"Error \"when cannot be None\" thrown in python/cpython.","triggerScenarios":"Raised when call_at() is invoked with when=None.","commonSituations":"See trigger scenarios.","solutions":["Pass an absolute time (e.g. loop.time() + delay) to loop.call_at(when, callback); compute the value instead of passing None."],"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"}