Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace deprecated asyncio.iscoroutinefunction with inspect.iscoroutinefunction #10473

Open
1 task done
kumaraditya303 opened this issue Feb 20, 2025 · 4 comments
Open
1 task done
Labels

Comments

@kumaraditya303
Copy link

Describe the bug

Python 3.14 deprecates asyncio.iscoroutinefunction in favor of inspect.iscoroutinefunction and aiohttp at some places uses the deprecated name so it should be changed to newer inspect.iscoroutinefunction.

To Reproduce

Run aiohttp tests on 3.14 to see the warnings.

Expected behavior

No warnings reported

Logs/tracebacks

NA

Python Version

$ python --version
Python 3.14.0a5+

aiohttp Version

$ python -m pip show aiohttp

multidict Version

$ python -m pip show multidict

propcache Version

$ python -m pip show propcache

yarl Version

$ python -m pip show yarl

OS

Linux

Related component

Client

Additional context

No response

Code of Conduct

  • I agree to follow the aio-libs Code of Conduct
@asvetlov
Copy link
Member

Thank you for raising the issue!

@Dreamsorcerer
Copy link
Member

Note that those functions are not equivalent, so there may be some issues migrating.
See the attempt on async-lru already: aio-libs/async-lru#637

@Dreamsorcerer
Copy link
Member

I've not investigated enough to figure out if that's deliberate or a CPython bug that should be fixed..

@kumaraditya303
Copy link
Author

I looked at the linked aio-libs/async-lru#637, the fix for that is to call inspect.markcoroutinefunction on the object as that is now the official and supported way to mark such async functions, previously it required a private marker _is_coroutine.

https://github.com/aio-libs/async-lru/blob/284f36c24c5ed0873a72115a1ae88d6d89397da2/async_lru/__init__.py#L4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants