On Mon, 01 Sep 2014 01:15:12 +0300
Marko Rauhamaa <ma...@pacujo.net> wrote:
> 
> 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().

If the signal handler is called, the exception *will* be raised.
There's no guarantee at which point in the Python code it will be
raised (it's implementation-dependent), but it's near impossible to
protect regular Python code against such asynchronous exceptions.

Which is why you should switch to a wakeup fd scheme as mentioned by
Victor, if you want to rely on signals at all.

Regards

Antoine.


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to