[Python-checkins] python/dist/src/Lib asyncore.py,1.37,1.38

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Tue, 05 Nov 2002 10:41:23 -0800


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv30449

Modified Files:
	asyncore.py 
Log Message:
Fix an old bug in poll().  When a signal is handled while we're
blocked in select(), this will raise select.error with errno set to
EINTR.  The except clauses correctly ignores this error, but the rest
of the logic will then call read() for all objects in select's *input*
list of read file descriptors.  Then when an object's read_handler()
is naive, it will call recv() on its socket, which will raise an
IOError, and then asyncore decides to close the socket.  To fix this,
we simply return in this case.

Backport candidate.


Index: asyncore.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/asyncore.py,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** asyncore.py	26 Sep 2002 13:19:48 -0000	1.37
--- asyncore.py	5 Nov 2002 18:41:20 -0000	1.38
***************
*** 110,113 ****
--- 110,115 ----
                  if err[0] != EINTR:
                      raise
+                 else:
+                     return
  
          for fd in r: