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], [], []) print(os.read(rfd, 2)) -------------------------------- Resizing terminal window make SIGWINCH signal sent to Python process. But nothing written to fd I specified to set_wakeup_fd(). I checked Modules/signalmodule.c and found I should assign signal handler for the signal I want to wakeup fd. So following code works as I expected. -------------------------------- import select, os, signal rfd, wfd = os.pipe() os.set_blocking(wfd, False) signal.set_wakeup_fd(wfd) signal.signal(signal.SIGWINCH, lambda *args:0) select.select([rfd], [], []) print(os.read(rfd, 2)) -------------------------------- Is this an expected behavior of signal.set_wakeup_fd()? ---------- components: Library (Lib) messages: 253468 nosy: ishimoto priority: normal severity: normal status: open title: signal.set_wakeup_fd() doesn't work if the signal don't have handler versions: Python 3.5 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25482> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com