-
Notifications
You must be signed in to change notification settings - Fork 333
Fix GreenFileIO.readall() for regular file #257
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
Conversation
|
ping? |
|
Hey @Haypo, do you mind moving the code in |
GreenFileIO.readall() calls _trampoline(self, read=True). Problem: on regular file, epoll_ctl() fails with EPERM on Linux, because regular files are not supported. This change skips the call to _trampoline() on regular files. Add also various unit tests on the various ways to read the whole content of a file.
Sure, it's done. |
| if get_errno(e) not in SOCKET_BLOCKING: | ||
| raise IOError(*e.args) | ||
| self._trampoline(self, read=True) | ||
| if not self._is_regular: |
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.
According to stat() documentation, file descriptor may be a regular file, directory, symlink, block or char device, socket and fifo. What are supported types? Is it possible to use white list instead? Check that fd is of supported type.
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.
hm. looking at this again actually makes me wonder if #314 is a better fix. the problem is triggered when we call epoll.register on a regular file, but we should only be doing that when we catch something in SOCKET_BLOCKING. if i understand things correctly, this should never be raised from regular files.
|
this should be fixed by #314 |
|
Sorry, I'm not interested to update this old pull request anymore, so I just close it. |
|
problem is already fixed by #314 i think |
GreenFileIO.readall() calls _trampoline(self, read=True). Problem: on
regular file, epoll_ctl() fails with EPERM on Linux, because regular
files are not supported.
This change skips the call to _trampoline() on regular files. Add
also various unit tests on the various ways to read the whole content
of a file.