<div dir="ltr"><div>Good sleuthing! Does the attached patch fix it?<br><br></div>(Off-topic: the code is pretty inconsistent about catching BaseException. Maybe it shouldn't be caught at all?)<br></div><div class="gmail_extra">

<br><br><div class="gmail_quote">On Fri, Oct 18, 2013 at 2:04 PM, Richard Oudkerk <span dir="ltr"><<a href="mailto:shibturn@gmail.com" target="_blank">shibturn@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">On 18/10/2013 9:19pm, Guido van Rossum wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Maybe the dummy socket returned by wrap_socket() is not acceptable for<br>
select?<br>
</blockquote>
<br></div>
An error<br>
<br>
    SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:553)')<br>
<br>
is being raised in _on_handshake().  This seems to result in the socket being closed without being unregistered from the selector.<br>
<br>
select() fails before the SSLError gets reported, so it does not appear in the traceback.<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Richard<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>--Guido van Rossum (<a href="http://python.org/~guido">python.org/~guido</a>)
</div>