[issue22018] signal: accept socket for signal.set_wakeup_fd()

2014-07-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 42cf963e3ab1 by Victor Stinner in branch 'default': Issue #22018: signal.set_wakeup_fd() now raises an OSError instead of a http://hg.python.org/cpython/rev/42cf963e3ab1 -- ___ Python tracker

[issue22018] signal: accept socket for signal.set_wakeup_fd()

2014-07-21 Thread STINNER Victor
STINNER Victor added the comment: > My worry is that somehow a program has a fd that refers to both a file and a > socket. But I agree that changing the API is not a great option either. Well, when I read again my patch and played with it, I saw that it has different issues: - a Windows socke

[issue22018] signal: accept socket for signal.set_wakeup_fd()

2014-07-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6b536f0516ea by Victor Stinner in branch 'default': Issue #22018: Add _testcapi.raise_signal() http://hg.python.org/cpython/rev/6b536f0516ea -- nosy: +python-dev ___ Python tracker

[issue22018] signal: accept socket for signal.set_wakeup_fd()

2014-07-20 Thread Guido van Rossum
Guido van Rossum added the comment: My worry is that somehow a program has a fd that refers to both a file and a socket. But I agree that changing the API is not a great option either. -- ___ Python tracker __

[issue22018] signal: accept socket for signal.set_wakeup_fd()

2014-07-20 Thread STINNER Victor
STINNER Victor added the comment: I don't understand. My patch works for files and sockets on all platforms. What is the problem? You don't like the idea of checking the file type? -- ___ Python tracker ___

[issue22018] signal: accept socket for signal.set_wakeup_fd()

2014-07-20 Thread Guido van Rossum
Guido van Rossum added the comment: So perhaps an int or a socket? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue22018] signal: accept socket for signal.set_wakeup_fd()

2014-07-20 Thread STINNER Victor
STINNER Victor added the comment: > Perhaps the API should take a socket object on Windows to avoid any confusion? I don't know if the feature is useful, but signal.set_wakeup_fd() works on Windows since at least Python 2.7 and accepts files. Only supporting sockets would be a regression. ---

[issue22018] signal: accept socket for signal.set_wakeup_fd()

2014-07-20 Thread Guido van Rossum
Guido van Rossum added the comment: Perhaps the API should take a socket object on Windows to avoid any confusion? -- ___ Python tracker ___ _

[issue22018] signal: accept socket for signal.set_wakeup_fd()

2014-07-20 Thread STINNER Victor
STINNER Victor added the comment: Guido wrote: "I don't know much about how sockets are implemented on Windows; is there a guarantee that the space of possible socket fds doesn't overlap the space of possible stream fds?" Python has a low-level _PyVerify_fd() which uses the __pioinfo private a

[issue22018] signal: accept socket for signal.set_wakeup_fd()

2014-07-20 Thread Guido van Rossum
Guido van Rossum added the comment: I don't know much about how sockets are implemented on Windows; is there a guarantee that the space of possible socket fds doesn't overlap the space of possible stream fds? -- ___ Python tracker

[issue22018] signal: accept socket for signal.set_wakeup_fd()

2014-07-20 Thread STINNER Victor
STINNER Victor added the comment: I tested manually test_signal.test_socket() on Windows 7: the test pass. The test is currently skipped on Windows because the whole TestCase is skipped. Moreover, there is no socket.socketpair() function on Windows. For the manual test, I used asyncio.windows_

[issue22018] signal: accept socket for signal.set_wakeup_fd()

2014-07-20 Thread STINNER Victor
New submission from STINNER Victor: Hi, I'm working on asyncio, someone asked why asyncio cannot be interrupted by CTRL+c (SIGINT): https://code.google.com/p/tulip/issues/detail?id=191 On Windows, select.select() is not interrupted by CTRL+c. To get a reliable behaviour, interrupt select.sele