classification
Title: Solaris: EINTR exception in select/socket calls in telnetlib
Type: behavior Stage: test needed
Components: Library (Lib) Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: jackdied Nosy List: brauwerman, jackdied, neologix, vstinner
Priority: normal Keywords:

Created on 2004-10-18 17:39 by brauwerman, last changed 2014-07-18 22:09 by vstinner. This issue is now closed.

Messages (4)
msg60587 - (view) Author: Mike Brauwerman (brauwerman) Date: 2004-10-18 17:39
On Solaris, calls to select.select() and
socket.socket() in telnetlib (and possibly others)
often fail due to unhandled EINTR signals from the OS
while select() is polling.

I think this problem is Solaris-specific since Solaris
has interruptible non-restartable sytem calls.

This behavior is apparently a known issue with the
system API select(); see
  man -s3c select
and
http://lists.community.tummy.com/pipermail/frpythoneers/2000-August/000122.html

The recommend fix from frpythoneers is to wrap the
select (and socket, respectively) calls in a loop:

while True:
  try:
    select.select(...)
    break
  except select.error, v:
    if v[0] == errno.EINTR: continue
    else:        raise 


It's probably more appropriate to put the
exception-handling *inside* select.select (and
socket.socket) but that's beyond my expertise...


OS: SunOS 5.9 Generic_112233-11 sun4u sparc
SUNW,Sun-Blade-100
msg85037 - (view) Author: Jack Diederich (jackdied) * (Python committer) Date: 2009-04-01 16:21
assigning all open telnetlib items to myself
msg223440 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-07-18 21:50
The telnetlib now uses the new selectors introduced in Python 3.4: see the issue #19170. The selectors module handles InterruptedError (EINTR): it returns an empty list of events in this case.

The changeset f713d9b6393c of the issue #19170 fixed this issue.

Sorry for the delay, 10 years to fix this bug... It's probably because the telnetlib module is not widely used...
msg223443 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-07-18 22:09
By the way, the bug was only fixed in Python 3.4 and later. I'm not interested to fix it in older Python versions.
History
Date User Action Args
2014-07-18 22:09:57vstinnersetmessages: + msg223443
versions: + Python 3.4, Python 3.5, - Python 3.1, Python 2.7, Python 3.2
2014-07-18 21:50:17vstinnersetstatus: open -> closed

nosy: + vstinner, neologix
messages: + msg223440

resolution: fixed
2010-08-19 17:46:49BreamoreBoysetversions: + Python 3.1, Python 2.7, Python 3.2, - Python 2.6
2009-04-01 16:21:06jackdiedsetassignee: jackdied

messages: + msg85037
nosy: + jackdied
2009-02-14 18:19:39ajaksu2setstage: test needed
type: behavior
versions: + Python 2.6, - Python 2.3
2004-10-18 17:39:51brauwermancreate