[issue29332] Uniform SelectSelector._select behavior

2017-01-20 Thread Wen Adam

Wen Adam added the comment:

I know it works on python3.4, but black magic still exists in selectors lib,and 
3rd-party module have to prepare two function to make compatibility.

--

___
Python tracker 

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



[issue29332] Uniform SelectSelector._select behavior

2017-01-20 Thread Berker Peksag

Berker Peksag added the comment:

Great! Since this is no longer an issue on Python 3.4+, I'm going to close this 
as a duplicate of issue 27634 and merge 
https://github.com/berkerpeksag/selectors34/pull/4.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> selectors.SelectSelectors fails if select.select was patched

___
Python tracker 

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



[issue29332] Uniform SelectSelector._select behavior

2017-01-20 Thread Wen Adam

Wen Adam added the comment:

Thx for your replying, Peksag.

I encountered this problem is really because of Gevent and Selector34. Gevent 
fixed this issue but only works for 
python3.4+(https://github.com/gevent/gevent/blob/master/src/gevent/monkey.py#L497)
 by a tricking way. python 2.x still has this problem

--

___
Python tracker 

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



[issue29332] Uniform SelectSelector._select behavior

2017-01-20 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the report! This is a duplicate of issue 27634.

Since we got multiple reports [1][2] about the same problem on selectors34 
(backport of selector module) and use of Gevent is very popular, I think we 
should reconsider the idea of wrapping select.select with staticmethod().

Also, if I remember correctly, this was fixed on Gevent's side before (although 
I know that you didn't mention Gevent in your report)

Victor and Charles-François, what do you think?

[1] https://github.com/berkerpeksag/selectors34/pull/4
[2] https://github.com/berkerpeksag/selectors34/issues/5

--
nosy: +berker.peksag, haypo

___
Python tracker 

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



[issue29332] Uniform SelectSelector._select behavior

2017-01-20 Thread Wen Adam

New submission from Wen Adam:

SelectSelector._select is differently on different platforms.

On win32, SelectSelector._select is a unbound/bound method and pass instance as 
the first argument, but on *nix, SelectSelector._select is a 
builtin_function_or_method(Although self.select still works)

If someone want to replace(or patch) select, he must implement two select 
function(one is a function, the other is a instance method), 
Otherwise you will get「TypeError: select() takes at most 4 arguments (5 given)」.

And I think make built-in funtion(like len, select.select) as a class 
attr/method is a black magic(it's still a function) and hard to maintain

--
components: Library (Lib)
files: uniform_select_behaviour.patch
keywords: patch
messages: 285891
nosy: Wen Adam, neologix
priority: normal
severity: normal
status: open
title: Uniform SelectSelector._select behavior
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file46352/uniform_select_behaviour.patch

___
Python tracker 

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