<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jul 26, 2016 at 5:55 AM, Yuya Nishihara <span dir="ltr"><<a href="mailto:yuya@tcha.org" target="_blank">yuya@tcha.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, 25 Jul 2016 20:57:55 -0400, Matt Harbison wrote:<br>
> On Mon, 25 Jul 2016 15:01:08 -0400, Gregory Szorc<br>
> <<a href="mailto:gregory.szorc@gmail.com">gregory.szorc@gmail.com</a>> wrote:<br>
><br>
> > # HG changeset patch<br>
> > # User Gregory Szorc <<a href="mailto:gregory.szorc@gmail.com">gregory.szorc@gmail.com</a>><br>
> > # Date 1469473255 25200<br>
> > #      Mon Jul 25 12:00:55 2016 -0700<br>
> > # Branch stable<br>
> > # Node ID 94abd7d9e7a1b8f689da7758927700a2e28959a6<br>
> > # Parent  9c2cc107547fd701a7604349632f2f590366f17c<br>
> > sslutil: work around SSLContext.get_ca_certs bug on Windows (issue5313)<br>
<br>
</span>Queued, thanks.<br>
<span class=""><br>
> > SSLContext.get_ca_certs() can raise<br>
> > "ssl.SSLError: unknown error (_ssl.c:636)" on Windows. See<br>
> > <a href="https://bugs.python.org/issue20916" rel="noreferrer" target="_blank">https://bugs.python.org/issue20916</a> for more info.<br>
> ><br>
> > We add a try..except that swallows the exception to work around<br>
> > this bug. If we encounter the bug, we won't print a warning<br>
> > message about attempting to load CA certificates. This is<br>
> > unfortunate. But there appears to be little we can do :/<br>
><br>
> This fixes it for me, thanks.<br>
><br>
> I wonder if the exception handler should duplicate the warning message,<br>
> since it looks like get_ca_certs() is the only thing that can throw<br>
> there.  OTOH, the output I got was pretty clear (though presumably there<br>
> are other reasons the certs could fail to load?)<br>
<br>
</span>I think it doesn't show the warning because the failure of get_ca_certs()<br>
doesn't mean no certs were loaded.<br>
</blockquote></div><br></div><div class="gmail_extra">Right. If get_ca_certs() fails due to the CPython bug, it likely means CAs were loaded. And since the warning message relates to lack of CAs being loaded, we don't need to display it.<br></div><div class="gmail_extra"><br></div></div>