-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
bpo-30098: Adds verbose error to asyncio.ensure_future #1170
Conversation
Adds a verbose type error when a concurrent.futures.Future object is passed into the asyncio.ensure_future function.
@crenwick, thanks for your PR! By analyzing the history of the files in this pull request, we identified @1st1, @bitdancer and @Mariatta to be potential reviewers. |
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA. This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. Thanks again to your contribution and we look forward to looking at it! |
Hi, code changes like this aren't considered trivial. Please create an issue in the bug tracker https://bugs.python.org Thanks :) |
Filed! (I also signed the CLA.) |
Thanks :) I changed the title to include the bpo-# The CLA can take one business day before it gets updated to your account. |
Removes the verbose error that is raised only when a concurrent.futures.Future object is passed into `ensure_future`, and instead changes the language of the already existing TypeError to read `asyncio.Future` instead of just `Future`
@crenwick Did you update your bpo profile with your GH username? |
Thanks @crenwick and congrats for your first contribution to CPython 🎉 I will backport this later today. |
…o.Future (pythonGH-1170) (cherry picked from commit ae5b326)
…o.Future (pythonGH-1170) (cherry picked from commit ae5b326)
Despite the shy mention in the docs, it was not clear to me that the future returned from
asyncio.run_coroutine_threadsafe
is not compatible withasyncio.ensure_future
(and other asyncio functions), and it took me a fair amount of frustration and source-code-digging to figure out what was going on.To avoid this confusion for other users, I think that a verbose TypeError warning when a concurrent.futures.Future object is passed into
asyncio.ensure_future
would be very helpful.Few questions:
Let me know what you think! Thanks!