-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
gh-83854: Map errno==ETIME
to TimeoutError
#20253
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
base: main
Are you sure you want to change the base?
gh-83854: Map errno==ETIME
to TimeoutError
#20253
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc/library/exceptions.rst needs to be updated as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to add a test for this? I realize it might be difficult, so it's not a show stopper, but it would be good to test newly added code. There are a few ETIMEDOUT tests, so maybe they could be used as a guide?
Misc/NEWS.d/next/Library/2020-05-19-23-16-53.bpo-39673.ppfScY.rst
Outdated
Show resolved
Hide resolved
Updated blurb to reflect that it's an OSError that's being mapped to a TimeoutError.
@@ -65,7 +65,7 @@ def test_select_error(self): | |||
+-- NotADirectoryError ENOTDIR | |||
+-- PermissionError EACCES, EPERM | |||
+-- ProcessLookupError ESRCH | |||
+-- TimeoutError ETIMEDOUT | |||
+-- TimeoutError ETIME, ETIMEDOUT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this test is as good as we're going to get.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I'm having second thoughts w.r.t. this PR (especially after the discussion
on python-dev). I don't know a lot about ETIME. I'm not sure if I should have submitted this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ZackerySpytz No need to worry, its only being added to future version of python. With more and more async style coding being adapted ETIME
will be handy to have as TimeoutError. It should have been adapted a long time ago but i suppose no one wanted to bother submitting a PR for it.
errno==ETIME
to TimeoutError
https://bugs.python.org/issue39673