Skip to content

asyncio: Confusing TimeoutError #106068

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

Closed
prabhu-yu opened this issue Jun 24, 2023 · 5 comments
Closed

asyncio: Confusing TimeoutError #106068

prabhu-yu opened this issue Jun 24, 2023 · 5 comments
Labels
docs Documentation in the Doc dir easy topic-asyncio

Comments

@prabhu-yu
Copy link

In many example code in the URL Coroutines and Tasks, TimeoutError exception is caught using

except TimeoutError

But it should be

except asyncio.TimeoutError

Also, not all hyperlinks to TimeoutError points to the
asyncio.TimeoutError, but to the standard TimeoutError

@prabhu-yu prabhu-yu added the docs Documentation in the Doc dir label Jun 24, 2023
@sunmy2019
Copy link
Member

sunmy2019 commented Jun 25, 2023

They are the same thing since 3.11.

https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError

@prabhu-yu
Copy link
Author

prabhu-yu commented Jun 25, 2023

Thank you, I was not aware of this.
Further, it says "A deprecated alias of TimeoutError".
So, 3.11.4 revision, I still see the many reference of asyncio.TimeoutError.
This should be simply TimeoutError, since "asyncio.TimeoutError" is deprecated in 3.11.
Please let me know if I am correct.

@sunmy2019
Copy link
Member

Yes

Docs can be updated if any one is willing to make a PR.

@hugovk
Copy link
Member

hugovk commented Jun 28, 2023

Thanks for the report.

Docs fixed in #106136 and backported in #106179 and #106180.

@hugovk hugovk closed this as completed Jun 28, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in asyncio Jun 28, 2023
@pullagad
Copy link

Thanks for the report.

Docs fixed in #106136 and backported in #106179 and #106180.

You are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir easy topic-asyncio
Projects
Status: Done
Development

No branches or pull requests

6 participants