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
asyncio docs refer to wrong TimeoutError #65575
Comments
Example: https://docs.python.org/3.4/library/asyncio-task.html |
Gasp. Perhaps concurrent.futures.TimeoutError can inherit from the standard TimeoutError? The following patch doesn't seem to disrupt the test suite: diff --git a/Lib/concurrent/futures/_base.py b/Lib/concurrent/futures/_base.py
--- a/Lib/concurrent/futures/_base.py
+++ b/Lib/concurrent/futures/_base.py
@@ -49,7 +49,7 @@ class CancelledError(Error):
"""The Future was cancelled."""
pass
-class TimeoutError(Error):
+class TimeoutError(Error, TimeoutError):
"""The operation exceeded the given deadline."""
pass |
I considered this, and decided against unifying the two TimeoutErrors. First the builtin TimeoutError is specifically a subclass of OSError representing the case where errno is ETIMEDOUT. But asyncio.TimeoutError means nothing of the sort. Second, the precedent is concurrent.futures.TimeoutError. The asyncio one is used under the same conditions as that one. I think we should just update the links in the docs to be correct. |
New changeset 6d90e8df01f4 by Victor Stinner in branch '3.4': New changeset 03bb1077b362 by Victor Stinner in branch 'default': |
Thanks for the report. In fact, asyncio.TimeoutError was not documented at all. It should now be fixed. |
Note: 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: