-
-
Notifications
You must be signed in to change notification settings - Fork 32k
support for Awaitable objects in asyncio.wait
removed in 3.11
#95601
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
Comments
I think using something like this might help? def _insist_future(f, loop):
f2 = ensure_future(f, loop=loop)
if f2 is not f:
warnings.warn("passing non-futures is deprecated")
return f2 fs = set(fs)
loop = events.get_running_loop()
if any(coroutines.iscoroutine(f) for f in fs):
raise TypeError("Passing coroutines is forbidden, use tasks explicitly.")
fs = {_insist_future(f, loop=loop) for f in fs}
return await _wait(fs, timeout, return_when, loop) |
asyncio.wait_for
removed in 3.11asyncio.wait
removed in 3.11
This was intended to be deprecated in 3.10 so I'm tentatively adding the 3.10 label |
So what is the bug exactly? Was the deprecation schedule not followed properly? Or do you just disagree with the deprecation and subsequent removal? In that case, tough luck. The release manager isn't going to allow the removal to be reversed. |
The deprecation schedule was not followed properly. The removal didn't match the deprecation, and support for iterables was removed. There's more discussion on the PR |
Now that the PR is closed, can you come up with a better description? It should describe a desired course of action. |
I upgrade some projects to 3.11 and got the same issue. We usually fix python deprecation warning the day python released a version, but we missed that one. The real root cause issue, I guess, is that the deprecation warning of python < 3.11 was not working for this kind of object:
|
* use sys.executable for python binary * pass the desired frame to traceback.walk_stack for 3.11 see python/cpython#96092 and it's not really intended for use outside of StackSummary.extract, see python/cpython#99015 (comment) * the GC overhead now depends on _PyType_PreHeaderSize faster-cpython/ideas#125 python/cpython@8319114#diff-a3a5c73931235f7f344c072dc755d6508e13923db3f5d581c5e88652075871cbR1684 * GH-6785: asyncio.wait no longer calls ensure_future python/cpython#95601 * test on python 3.11 * exclude macos py 3.10
@graingert are you going to follow up on this? If not I am inclined to just close it, 3.11 is far ahead in release cycle now anyways. |
Closing because of no response to my and Guido's comment. |
Uh oh!
There was an error while loading. Please reload this page.
on
python3.10 -W error
this passes:and in 3.11 this fails:
this broke distributed and we missed the DeprecationWarning because ensure_future accepts a wider variety of objects than just futures tasks and coroutines
dask/distributed#6785
the removal happened here 903f0a0
The text was updated successfully, but these errors were encountered: