[Python-Dev] RFC: PEP 475, Retry system calls failing with EINTR

Victor Stinner victor.stinner at gmail.com
Mon Sep 1 00:45:22 CEST 2014

Le 1 sept. 2014 00:17, "Marko Rauhamaa" <marko at pacujo.net> a écrit :
> If a signal is received when read() or write() has completed its task
> partially (> 0 bytes), no EINTR is returned but the partial count.
> Obviously, Python should take that possibility into account so that
> raising an exception in the signal handler (as mandated by the PEP)
> doesn't cause the partial result to be lost on os.read() or os.write().

This case is unrelated to the PEP, the PEP only changes the behaviour when
a syscall fails with EINTR.

(When Python gets a signal, the C signal handler is immediatly called. The
handler sets a flag which is cheched before executing an instruction. The
Python signal handler can be called between two Python instructions. In
some cases, it may be called earlier in functions checking manually the
flag. IMO the exact behaviour is undefined. Python tries to call the Python
signal handler as soon as possible, with a low performance overhead.)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20140901/02cb80a5/attachment.html>

More information about the Python-Dev mailing list