-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Maybe a problem with trio-asyncio & python 3.8 #63
Comments
trio-asyncio is currently semi-maintained at best, and hasn't been adapted to the last two Trio releases (nor the 3.8 Python release). Feel free to submit patches. :-/ |
Good to know. Well I can wrap my fix together and submit a patch. It lets trio_asyncio run again on python 3.8. But honestly I do not know if the solutions is a good one. |
@OliverTED Hello, could you share your workaround? It freaks me out these days. |
Sure. Here is the code that worked for me (I tested this only on little and only on python 3.8):
|
Not sure if related, but I had to put the following at the top of my first async function (called by trio_asyncio.run): # noinspection PyProtectedMember
asyncio._set_running_loop(asyncio.get_event_loop()) |
@OliverTED Really sorry for the slow response. At the end of 2019, I'm a little busy, some from life, some from work. |
Same problem with Python 3.7.5 when use aioredis==1.3.1. Code sample: import aioredis
import trio_asyncio
from functools import partial
async def main():
create_redis_pool = partial(
aioredis.create_redis_pool,
address='...',
encoding='utf-8'
)
redis = await trio_asyncio.run_asyncio(create_redis_pool)
print('Redis connected')
trio_asyncio.run(main) Got similar traceback:
Workaround suggested above works fine. Thanks to @parity3 ! |
Can you please try the 0.11.0 release and tell us if it helps? |
This error appears to be resolved in 0.11.0, so closing. Please feel free to reopen if your issue is indeed unresolved. |
Hey there! I have problems calling asyncio code from trio using trio_asyncio in python 3.8.
The following example is almost identical to the one from the docs. It works in python 3.7, but fails in python 3.8. After adding the monkeypatching flagged by the 'if False', it also works in python 3.8. Am I doing something wrong?
Thanks!
Here is the error in python 3.8:
The text was updated successfully, but these errors were encountered: