Le 1 sept. 2014 00:04, "Marko Rauhamaa" <marko@pacujo.net> a écrit :
>
> Victor Stinner <victor.stinner@gmail.com>:
>
> > But I don't get you point. How does this PEP make the situation worse?
>
> Did I say it would? I just wanted to make sure the system call
> resumption doesn't become mandatory.

The syscall is only retried on EINTR if the signal handler didn't raise an exception. So it is not always retried:

"Proposition

If a system call fails with ``EINTR``, Python must call signalhandlers: call ``PyErr_CheckSignals()``. If a signal handler raisesan exception, the Python function fails with the exception.Otherwise, the system call is retried.  If the system call takes atimeout parameter, the timeout is recomputed."

> Haven't thought through what the exception raising technique would
> entail. It might be perfectly ok apart from being a change to the signal
> handler API.

I don't think that it is safe to expect an InterruptedError if the signal handler doesn't raise an exception. Many Python module already retry the syscall on EINTR.

So I'm not sure that the PEP is really a major change. It's just to make Python more homogeneous, always have the same reliable and portable behaviour.

Victor