-
-
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-32410: Make SendfileNotAvailableError public #5243
bpo-32410: Make SendfileNotAvailableError public #5243
Conversation
Lib/asyncio/base_events.py
Outdated
if fallback: | ||
return await self._sock_sendfile_fallback(sock, file, | ||
offset, count) | ||
else: | ||
raise RuntimeError(exc.args[0]) from None | ||
raise |
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.
Can we reformat this code to:
except events.SendfileNotAvailable:
if not fallback:
raise
return await self._sock_sendfile_fallback(sock, file, offset, count)
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.
Done
Doc/library/asyncio-eventloop.rst
Outdated
|
||
Sendfile syscall is not available, subclass of :exc:`RuntimeError`. | ||
|
||
Raised if Operation System does not support senfile syscall for |
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.
... Raised if the OS...
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.
Done
Doc/library/asyncio-eventloop.rst
Outdated
-------------------- | ||
|
||
|
||
.. exception:: SendfileNotAvailable |
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.
One more nit: can we call it SendfileNotAvailableError
? The Error
suffix is used for 99% of exceptions in Python.
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.
Good catch. Done
@asvetlov - just curious, why did you skip-news for this new Exception introduction? |
This is a follow-up PR; we already have a NEWS entry for loop.sock_sendfile. |
https://bugs.python.org/issue32410