This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ishimoto
Recipients ishimoto
Date 2015-10-26.11:34:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1445859296.06.0.537058365711.issue25482@psf.upfronthosting.co.za>
In-reply-to
Content
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()?
History
Date User Action Args
2015-10-26 11:34:56ishimotosetrecipients: + ishimoto
2015-10-26 11:34:56ishimotosetmessageid: <1445859296.06.0.537058365711.issue25482@psf.upfronthosting.co.za>
2015-10-26 11:34:56ishimotolinkissue25482 messages
2015-10-26 11:34:55ishimotocreate