[issue25680] Selector.select() hangs when there is nothing to select

2015-11-20 Thread Aleksey Kladov

New submission from Aleksey Kladov:

The following hangs on Linux

```Python
>>> import selectors
>>> s = selectors.DefaultSelector()
>>> s.select()
```

On Mac it returns an empty list.

------
messages: 254975
nosy: Aleksey Kladov
priority: normal
severity: normal
status: open
title: Selector.select() hangs when there is nothing to select
versions: Python 3.5

___
Python tracker 
<http://bugs.python.org/issue25680>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25680] Selector.select() hangs when there is nothing to select

2015-11-21 Thread Aleksey Kladov

Aleksey Kladov added the comment:

>What's the point of your bug report?

To show surprising platform-dependent API behavior. I don't know what is the 
correct behavior here, but it should be cross platform. Seems like the most 
sane option is to throw an exception. 


>Does your application really rely on the behaviour of the selector when no 
>file descriptor is registered?

It was developed on Mac and relied (quite probably incorrectly) on the empty 
list result. When I run it on linux, it unexpectedly hanged.

So, I would like to either

* observe an exception on all platforms
* observe an empty list on all platforms
* observe infinite blocking on all platforms

I think this special case should also be mentioned in the docs.

--

___
Python tracker 
<http://bugs.python.org/issue25680>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25680] Selector.select() hangs when there is nothing to select

2015-11-22 Thread Aleksey Kladov

Aleksey Kladov added the comment:

>I disagree, we can do better than documenting "bugs" :-)

The result of `select.select([], [], [], None)` should defintelly be 
documented. 

Three platoforms made three different decisions in similar situation, so any 
behavior is reasonable and it should be made clear which one is used by Python.

--

___
Python tracker 
<http://bugs.python.org/issue25680>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com