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
Task.current_task(None) returns unexpected result #73457
Comments
Quoting Alberto Berdi from python-tulip mailing list: working with the Python 3.6 asyncio implemented in C, i've got what is import asyncio
async def coro():
print(asyncio.Task.current_task())
print(asyncio.Task.current_task(None))
print(asyncio.Task.current_task(loop=asyncio.get_event_loop()))
loop = asyncio.get_event_loop()
loop.run_until_complete(coro()) in Py3.5, I obtain the result: <Task pending coro=<coro() running at test_task.py:4> cb=[_run_until_complete_cb() at /usr/lib/python3.5/asyncio/base_events.py:176]> In Py3.6, i get: <Task pending coro=<coro() running at test_task.py:4> cb=[_run_until_complete_cb() at /usr/lib/python3.6/asyncio/base_events.py:176]> What's going on here? It's still right to expect the same result from the three calls or something has changed? My python3.6 has version: $ python3.6 -VV
Python 3.6.0 (default, Dec 29 2016, 04:29:02)
[GCC 6.2.1 20161215] |
FWIW, the problem afflicts other functions, for example the following script exhibits a similar difference: import asyncio
async def coro():
print(asyncio.Task.all_tasks())
print(asyncio.Task.all_tasks(None))
loop = asyncio.get_event_loop()
loop.run_until_complete(coro()) |
Yay, Yury is too fast!! :-) |
LGTM |
Misc/NEWS
so that it is managed by towncrier #552Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: