Socket read weirdness

Matthew Dixon Cowles matt at mondoinfo.com
Thu May 3 00:39:56 EDT 2001


On Wed, 02 May 2001 22:23:58 -0500, Casey Crabb
<crabbkw at nafai.dyndns.org> wrote:

> Ok, I have discovered a strange issue with sockets:
> Here's the situation:
> I am in X, or windows, and have a term open running a command-line
> python program
> I have a thread which is reading from the socket.
> If I resize the terminal the read from the socket is broken:
> I am returned a socket.error, (4, 'Interrupted system call'),
> <traceback object at 0x82deb88>
> The also occurs if I restart my window manager (FVWM2)
> My question is: What does resizing the window running a command-line
> python application have to do with reading from a socket?

I don't know for sure, but I'd bet that your app is receiving the
signal SIGWINCH (window change) and that's interrupting the call. You
might try something like:

signal.signal(signal.SIGWINCH,signal.SIG_IGN)

and see if that helps.

Regards,
Matt



More information about the Python-list mailing list