[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2015-01-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d3a27a27e008 by Victor Stinner in branch '3.4':
Issue #23009: Skip test_selectors.test_empty_select() on Windows
https://hg.python.org/cpython/rev/d3a27a27e008

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23009
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2015-01-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4f928c70f135 by Victor Stinner in branch '3.4':
Issue #23009: Add missing import sys in test_selectors
https://hg.python.org/cpython/rev/4f928c70f135

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23009
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1e985daa7be6 by Victor Stinner in branch 'default':
Issue #23009: Skip test_selectors.test_empty_select() on Windows
https://hg.python.org/cpython/rev/1e985daa7be6

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23009
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread Alexey Poryadin

New submission from Alexey Poryadin:

When is called `select`, but registered no one `fileobject` rise exception:
...
polled = self._selector.select(timeout)
  File /usr/lib/python3.4/selectors.py, line 424, in select
fd_event_list = self._epoll.poll(timeout, max_ev)
ValueError: maxevents must be greater than 0, got 0

Of course, it makes no sense to call `select` if there is nothing to watch. But 
select.epol.poll is not raises exception in the same case if `max_ev`=-1. And 
this simplifies the application code and is useful if need just sleep for a 
timeout.

So, I suggest a small fix:
-fd_event_list = self._epoll.poll(timeout, max_ev)
+fd_event_list = self._epoll.poll(timeout, max_ev or -1)

--
messages: 232300
nosy: Alexey.Poryadin
priority: normal
severity: normal
status: open
title: selectors.EpollSelector.select raises exception when nothing to select.
type: behavior
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23009
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
nosy: +haypo, neologix

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23009
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
versions: +Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23009
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
components: +asyncio
nosy: +gvanrossum, yselivanov

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23009
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread Yury Selivanov

Yury Selivanov added the comment:

Patch attached. Tests pass on Linux.

--
keywords: +patch
Added file: http://bugs.python.org/file37387/epoll_01.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23009
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread STINNER Victor

STINNER Victor added the comment:

+s.select(timeout=0)

I suggest to ensure that the result is an empty list.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23009
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread Yury Selivanov

Changes by Yury Selivanov yseliva...@gmail.com:


Added file: http://bugs.python.org/file37388/epoll_02.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23009
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread Yury Selivanov

Yury Selivanov added the comment:

I agree. Please see another one.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23009
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread STINNER Victor

STINNER Victor added the comment:

It's a little bit surprising to call epoll_wait() without any FD subscribed, 
but select([], [], [], delay) is a known way to sleep 'delay' seconds, so why 
not using epoll in a similar way? :-)

epoll_02.patch looks good to me. Can you please also apply the patch to the 
Tulip project?

(By the way, test_selectors.py to Tulip is completly different, we may just 
reuse the file from CPython and drop the code from Tulip.)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23009
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread Guido van Rossum

Guido van Rossum added the comment:

Please add a comment explaining the complaint from epoll.poll() we're
trying to avoid here.

I presume Tulip never gets into this state because of the self-pipe.

On Mon, Dec 8, 2014 at 8:01 AM, STINNER Victor rep...@bugs.python.org
wrote:


 STINNER Victor added the comment:

 It's a little bit surprising to call epoll_wait() without any FD
 subscribed, but select([], [], [], delay) is a known way to sleep 'delay'
 seconds, so why not using epoll in a similar way? :-)

 epoll_02.patch looks good to me. Can you please also apply the patch to
 the Tulip project?

 (By the way, test_selectors.py to Tulip is completly different, we may
 just reuse the file from CPython and drop the code from Tulip.)

 --

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue23009
 ___


--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23009
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b2ee06684b6a by Yury Selivanov in branch '3.4':
selectors: Make sure EpollSelecrtor.select() works when no FD is registered.
https://hg.python.org/cpython/rev/b2ee06684b6a

New changeset 202995833ef4 by Yury Selivanov in branch 'default':
selectors: Make sure EpollSelecrtor.select() works when no FD is registered.
https://hg.python.org/cpython/rev/202995833ef4

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23009
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread Yury Selivanov

Yury Selivanov added the comment:

 Please add a comment explaining the complaint from epoll.poll() we're
trying to avoid here.

Good point! Committed.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23009
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread Yury Selivanov

Changes by Yury Selivanov yseliva...@gmail.com:


--
resolution:  - fixed
stage:  - resolved
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23009
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread Charles-François Natali

Charles-François Natali added the comment:

Thanks for taking care of this.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23009
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23009] selectors.EpollSelector.select raises exception when nothing to select.

2014-12-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8f1be68dfcab by Yury Selivanov in branch '3.4':
NEWS: Add news entry for issue #23009.
https://hg.python.org/cpython/rev/8f1be68dfcab

New changeset d36711410f48 by Yury Selivanov in branch 'default':
NEWS: Add news entry for issue #23009.
https://hg.python.org/cpython/rev/d36711410f48

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23009
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com