msg195721 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2013-08-20 22:20 |
select.epoll and select.kqueue objects have a close() method, but not select.poll objects, whereas all these objects store internally a file descriptor. select.poll lacks also a fileno() method. I added the fileno() method in my implementation of the PEP 446 (see issue #18571). |
|
|
msg195723 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2013-08-20 22:21 |
See also issue #16853 "add a Selector to the select module". |
|
|
msg195725 - (view) |
Author: Guido van Rossum (gvanrossum) *  |
Date: 2013-08-20 22:33 |
This all sounds fine to fix without waiting for anything else -- can you attach a patch here? |
|
|
msg195748 - (view) |
Author: Charles-François Natali (neologix) *  |
Date: 2013-08-21 07:05 |
Just to be explicit (there are typos in Victor's original messages): it's about select.devpoll, for Solaris-derivatives with /dev/poll, and not for select.poll, based on poll() syscall. |
|
|
msg195757 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2013-08-21 09:25 |
"Just to be explicit (there are typos in Victor's original messages): it's about select.devpoll, for Solaris-derivatives with /dev/poll, and not for select.poll, based on poll() syscall." Oops sorry, yes, I'm talking about select.devpoll, its structure has a "int fd_devpoll;" field: typedef struct { PyObject_HEAD int fd_devpoll; int max_n_fds; int n_fds; struct pollfd *fds; } devpollObject; |
|
|
msg195765 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2013-08-21 10:23 |
"This all sounds fine to fix without waiting for anything else -- can you attach a patch here?" I opened the issue as a reminder for me. Here is a patch. * Add close() and fileno() methods and a closed attribute (property) to devpoll object * Document closed attribute of epoll and kqueue objects * Add tests on closed object for devpoll, epoll and kqueue. There was no test for devpoll, epoll nor kqueue :-( select.poll is still not tested. We should add much more tests, especially tests checking than a fd becomes ready for each implementation. We may develop these tests using #16853 ? I ran test_select on Linux, so I only checked the epoll unit test. The "closed" attribute of epoll and kqueue objects should also be documented in Python 2.7 and 3.3. |
|
|
msg195771 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2013-08-21 10:58 |
poll, devpoll, epoll and kqueue are tested in test_poll.py, test_devpoll.py, test_epoll.py and test_kqueue.py test files. |
|
|
msg195814 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2013-08-21 18:19 |
Updated patch: move tests to the right test files and test that close() can be called more than once. |
|
|
msg195826 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2013-08-21 22:21 |
New changeset ccbe2132392b by Victor Stinner in branch 'default': Close #18794: Add a fileno() method and a closed attribute to select.devpoll http://hg.python.org/cpython/rev/ccbe2132392b |
|
|
msg195827 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2013-08-21 22:21 |
Charles-François Natali and Guido van Rossum: thanks for your reviews ;-) |
|
|