[issue1068268] subprocess is not EINTR-safe

STINNER Victor report at bugs.python.org
Wed Dec 24 03:03:03 CET 2008


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

Instead of define a method for each "syscall", you can write a generic 
function that retry at OSError(EINTR):

def no_intr(self, func, *args, **kw):
  while True:
    try:
      return func(*args, **kw)
    except OSError, e:
      if e.errno == errno.EINTR:
        continue
      else:
        raise

x=_waitpid_no_intr(pid, options) becomes x=no_intr(os.waitpid, pid, 
options).

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1068268>
_______________________________________


More information about the Python-bugs-list mailing list