-
Notifications
You must be signed in to change notification settings - Fork 141
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
Backend specific options don't appear to be used #643
Comments
What backend options are you trying to pass? |
I was looking into enabling the uvloop option and was overall interested in which options where available. But, looking at the code, it appeared that the options weren't being used. |
On the asyncio backend, the |
@agronholm In the code I posted, the only mention of options.get("use_uvloop", False) Which fetches it from the options dictionary, but then does nothing with the value. I'm not super familiar with the anyio code, however, so, I apologize if its being used somewhere else. However, I tried the following test program: import anyio
import asyncio
async def inside_asyncio() -> None:
print(asyncio.get_running_loop())
anyio.run(inside_asyncio, backend_options={"use_uvloop": True}) When I run the above with anyio 3.7.1, it prints out:
However, when I run it with 4.1.0, it prints out:
|
Oh wow, I didn't see that. So apparently while they are used for the test runner, they're ignored for |
@DaGenix I trust that the linked PR fixes the issue? Would you mind taking a peek? |
@agronholm cool. that looks good to me! |
Things to check first
I have searched the existing issues and didn't find my bug already reported there
I have checked that my bug is still present in the latest release
AnyIO version
4.1.0
Python version
3.11
What happened?
As best as I can tell, the backend specific options for both the asyncio and trio options aren't being used
anyio/src/anyio/_backends/_asyncio.py
Lines 1939 to 1960 in cc18942
anyio/src/anyio/_backends/_trio.py
Lines 807 to 814 in cc18942
How can we reproduce the bug?
I'm sorry if I'm missing something, but the backend options don't appear to be used, except for
debug
for asyncio. I don't have a test case, however, so, I apologize again if I'm not seeing how the options are getting applied.The text was updated successfully, but these errors were encountered: