<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Fri, Aug 30, 2013 at 10:57 AM, Guido van Rossum <span dir="ltr"><<a href="mailto:guido@python.org" target="_blank">guido@python.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div>I don't have a strong opinion on this either. The distinction between send() and send_all() makes sense to me though (send_all() works hard to get all your data out, send() only does what it can quickly).<br>
<br></div>Personally for calls like select() I think returning early on EINTR makes sense, it's usually part of a select loop anyway.<br><br></div>The only thing I care deeply about is that you shouldn't restart anything before letting a Python-level signal handler run. A program might well have a Python signal handler that must run before the I/O is restarted, and the signal handler might raise an exception (like the default SIGINT handler, which raises KeyboardInterrupt).<br>
</div></blockquote><div><br></div><div>I see <a href="http://bugs.python.org/issue18885">http://bugs.python.org/issue18885</a> has been filed to track this discussion so we should probably move it there (I've added comments).</div>
<div><br></div><div>TL;DR you can't simply retry a system call with the exact same arguments when you receive an EINTR. There are some system calls for which that will not do what the programmer intended.</div><div> <br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">
</div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Fri, Aug 30, 2013 at 10:02 AM, Antoine Pitrou <span dir="ltr"><<a href="mailto:solipsis@pitrou.net" target="_blank">solipsis@pitrou.net</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div class="h5"><div>On Fri, 30 Aug 2013 12:29:12 +0200<br>
Charles-François Natali <<a href="mailto:cf.natali@gmail.com" target="_blank">cf.natali@gmail.com</a>> wrote:<br>
><br>
> Furthermore, the stdlib code base is not consistent: some code paths<br>
> handle EINTR, e.g. subprocess, multiprocessing, sock_sendall() does<br>
> but not sock_send()...<br>
> Just grep for EINTR and InterruptedError and you'll be amazed.<br>
><br>
> GHC, the JVM and probably other platforms handle EINTR, maybe it's<br>
> time for us too?<br>
<br>
</div>I don't have any precise opinion on this. It's true that we should have<br>
a systematic approach, I just don't know if all interfaces should<br>
handler EINTR automatically, or only the high-level ones.<br>
(for the sake of clarity, I'm fine with either :-))<br>
<br>
Regards<br>
<span><font color="#888888"><br>
Antoine.<br>
</font></span></div></div><div><div><div><div class="h5"><br>
<br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-dev" target="_blank">http://mail.python.org/mailman/listinfo/python-dev</a><br></div></div>
Unsubscribe: <a href="http://mail.python.org/mailman/options/python-dev/guido%40python.org" target="_blank">http://mail.python.org/mailman/options/python-dev/guido%40python.org</a><span class=""><font color="#888888"><br>
</font></span></div></div></blockquote></div><span class=""><font color="#888888"><br><br clear="all"><br>-- <br>--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)
</font></span></div>
<br>_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-dev" target="_blank">http://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="http://mail.python.org/mailman/options/python-dev/greg%40krypto.org" target="_blank">http://mail.python.org/mailman/options/python-dev/greg%40krypto.org</a><br>
<br></blockquote></div><br></div></div>