Issue 18794: select.devpoll objects have no close() method (original) (raw)

Created on 2013-08-20 22:20 by vstinner, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
devpoll_close.patch vstinner,2013-08-21 10:23 review
devpoll_close-2.patch vstinner,2013-08-21 18:19 review
Messages (10)
msg195721 - (view) Author: STINNER Victor (vstinner) * (Python committer) 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) * (Python committer) Date: 2013-08-20 22:21
See also issue #16853 "add a Selector to the select module".
msg195725 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) 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) * (Python committer) 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) * (Python committer) 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) * (Python committer) 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) * (Python committer) 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) * (Python committer) 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) (Python triager) 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) * (Python committer) Date: 2013-08-21 22:21
Charles-François Natali and Guido van Rossum: thanks for your reviews ;-)
History
Date User Action Args
2022-04-11 14:57:49 admin set github: 62994
2013-08-21 22:21:47 vstinner set messages: +
2013-08-21 22:21:04 python-dev set status: open -> closednosy: + python-devmessages: + resolution: fixedstage: needs patch -> resolved
2013-08-21 18:48:03 gvanrossum set nosy: - gvanrossum
2013-08-21 18:19:34 vstinner set files: + devpoll_close-2.patchmessages: +
2013-08-21 10:58:38 serhiy.storchaka set messages: +
2013-08-21 10:23:16 vstinner set files: + devpoll_close.patchkeywords: + patchmessages: +
2013-08-21 09:41:00 serhiy.storchaka set nosy: + serhiy.storchakastage: needs patch
2013-08-21 09:25:55 vstinner set messages: +
2013-08-21 07:05:54 neologix set messages: +
2013-08-21 04:10:21 jcea set nosy: + jcea
2013-08-20 22:33:53 gvanrossum set messages: +
2013-08-20 22:21:50 vstinner set messages: +
2013-08-20 22:20:01 vstinner create