curses, multiplexing, select / poll, and resizing
Donn Cave
donn at drizzle.com
Tue Jul 16 00:59:02 EDT 2002
Quoth frob1 at archerlabs.net (frobenius):
| preface: i'm new to python, semi-new to curses, but an otherwise
| experienced programmer.
I don't know beans about curses.
| i'm writing a telnet client using curses to separate input and output
| into different windows. to multiplex the I/O from the user and the
| host i'm using poll(). when i resize the terminal window (i'm using
| win32 PuTTY to connect to FreeBSD, running Python 2.2) i generate an
| exception which kills poll():
|
| Select Error: 4, Interrupted system call
...
| signal.signal(signal.SIGWINCH, self.handler_resize)
Right, that's your culprit. I believe you will conclude it's more
or less necessary, so you'll just have to trap the error around poll().
...
| - how to i capture and ignore this w/out accidentally capturing a real
| poll() error?
EINTR (4) means a "slow" system I/O was interrupted by signal delivery,
so I would check for err.args[0] == 4
Donn Cave, donn at drizzle.com
More information about the Python-list
mailing list