[issue25482] signal.set_wakeup_fd() doesn't work if the signal don't have handler

2015-10-30 Thread Atsuo Ishimoto
Atsuo Ishimoto added the comment: Ah, I didn't know it. Thank you for clarification. -- ___ Python tracker ___ ___ Python-bugs-list ma

[issue25482] signal.set_wakeup_fd() doesn't work if the signal don't have handler

2015-10-30 Thread STINNER Victor
STINNER Victor added the comment: Atsuo Ishimoto added the comment: > But I still think it is desirable for Python to have something like > signalfd(), because not all functions used in the signal handler of third > party library can be called from user's Python script in general. I don't thi

[issue25482] signal.set_wakeup_fd() doesn't work if the signal don't have handler

2015-10-30 Thread Atsuo Ishimoto
Atsuo Ishimoto added the comment: Yes, I can. So, for my custom text editor, problem have solved already. But I still think it is desirable for Python to have something like signalfd(), because not all functions used in the signal handler of third party library can be called from user's Pyth

[issue25482] signal.set_wakeup_fd() doesn't work if the signal don't have handler

2015-10-30 Thread STINNER Victor
STINNER Victor added the comment: > As in my previous example, if other 3rd party libraries(ncurses in my case) > need to handle the signal, signal is consumed by Python handler and not > delivered to the library. In the Python signal handler, can't you call the ncurses function that should be

[issue25482] signal.set_wakeup_fd() doesn't work if the signal don't have handler

2015-10-29 Thread Atsuo Ishimoto
Atsuo Ishimoto added the comment: Thank you for good sample. This should be written in PEP 475. But installing new signal handler can cause different behavior. As in my previous example, if other 3rd party libraries(ncurses in my case) need to handle the signal, signal is consumed by Python h

[issue25482] signal.set_wakeup_fd() doesn't work if the signal don't have handler

2015-10-29 Thread STINNER Victor
STINNER Victor added the comment: It's very easy to get the same behaviour on Python 3.4 (without PEP 475) and Python 3.5 (with PEP 475). Just add the following code at the top of your example: import signal def sighandler(signum, frame): raise InterruptedError signal.signal(signal.S

[issue25482] signal.set_wakeup_fd() doesn't work if the signal don't have handler

2015-10-29 Thread Atsuo Ishimoto
Atsuo Ishimoto added the comment: > Benjamin Peterson added the comment: > > The OP probably wants something like the Linux-specific signalfd() syscall. Yes. Long explanation: I have an console text editor written in Python/curses(http://kaaedit.github.io/). This editor didn't work with Pyt

[issue25482] signal.set_wakeup_fd() doesn't work if the signal don't have handler

2015-10-28 Thread Benjamin Peterson
Benjamin Peterson added the comment: The OP probably wants something like the Linux-specific signalfd() syscall. -- ___ Python tracker ___ ___

[issue25482] signal.set_wakeup_fd() doesn't work if the signal don't have handler

2015-10-28 Thread STINNER Victor
STINNER Victor added the comment: > IMO this reduces usefulness of set_wakeup_fd(). (...) Sorry, I don't understand your use case. Could you elaborate. What do you need? -- According to the GNU libc doc, the signal SIGWINCH is *ignored* by default: "Window size change. This is generated on som

[issue25482] signal.set_wakeup_fd() doesn't work if the signal don't have handler

2015-10-28 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.

[issue25482] signal.set_wakeup_fd() doesn't work if the signal don't have handler

2015-10-26 Thread Atsuo Ishimoto
Atsuo Ishimoto added the comment: Okay, so I think this needed to be documented in signal.set_wakeup_fd(). IMO this reduces usefulness of set_wakeup_fd(). If I need to install custom handler by my self, I can write to fd in my own custom handler. And, installing custom handler omits existing

[issue25482] signal.set_wakeup_fd() doesn't work if the signal don't have handler

2015-10-26 Thread Benjamin Peterson
Benjamin Peterson added the comment: Yes, you need to tell the kernel to not ignore SIGWINCH automatically for you. -- nosy: +benjamin.peterson resolution: -> not a bug status: open -> closed ___ Python tracker __

[issue25482] signal.set_wakeup_fd() doesn't work if the signal don't have handler

2015-10-26 Thread Atsuo Ishimoto
New submission from Atsuo Ishimoto: I expect following code prints '\x1c' when I resize terminal window on Linix/Mac terminal. import select, os, signal rfd, wfd = os.pipe() os.set_blocking(wfd, False) signal.set_wakeup_fd(wfd) select.select([rfd], [], []) pri