uvloop icon indicating copy to clipboard operation
uvloop copied to clipboard

DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated in uvloop.loop.Loop.run_in_executor in Python 3.14

Open MrNaif2018 opened this issue 3 months ago • 0 comments

Hi! Running uvloop under python 3.14, I get this warning. I think just changing https://github.com/MagicStack/uvloop/blob/74f4c96d3fc5281b1820491d2568de771ea7851b/uvloop/includes/stdlib.pxi#L40 this line should fix the issue

.venv/lib/python3.14/site-packages/aiofiles/base.py:69: in __await__
    self._obj = yield from self._coro.__await__()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.14/site-packages/aiofiles/threadpool/__init__.py:93: in _open
    f = await loop.run_in_executor(executor, cb)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
uvloop/loop.pyx:2734: in uvloop.loop.Loop.run_in_executor
    ???
/opt/homebrew/Cellar/[email protected]/3.14.0/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/coroutines.py:23: in iscoroutinefunction
    warnings._deprecated("asyncio.iscoroutinefunction",
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

name = 'asyncio.iscoroutinefunction', message = '{name!r} is deprecated and slated for removal in Python {remove}; use inspect.iscoroutinefunction() instead'

    def _deprecated(name, message=_DEPRECATED_MSG, *, remove, _version=sys.version_info):
        """Warn that *name* is deprecated or should be removed.
    
        RuntimeError is raised if *remove* specifies a major/minor tuple older than
        the current Python version or the same version but past the alpha.
    
        The *message* argument is formatted with *name* and *remove* as a Python
        version tuple (e.g. (3, 11)).
    
        """
        remove_formatted = f"{remove[0]}.{remove[1]}"
        if (_version[:2] > remove) or (_version[:2] == remove and _version[3] != "alpha"):
            msg = f"{name!r} was slated for removal after Python {remove_formatted} alpha"
            raise RuntimeError(msg)
        else:
            msg = message.format(name=name, remove=remove_formatted)
>           _wm.warn(msg, DeprecationWarning, stacklevel=3)
E           DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead

MrNaif2018 avatar Oct 19 '25 11:10 MrNaif2018