<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 2, 2017, at 12:41 PM, Antoine Pitrou <<a href="mailto:solipsis@pitrou.net" class="">solipsis@pitrou.net</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On Fri, 2 Jun 2017 12:22:06 -0400<br class="">Donald Stufft <<a href="mailto:donald@stufft.io" class="">donald@stufft.io</a>> wrote:<br class=""><blockquote type="cite" class=""><br class="">It’s not just bootstrapping that pip has a problem with for C extensions, it also prevents upgrading PyOpenSSL on Windows because having pip import PyOpenSSL locks the .dll, and we can’t delete it or overwrite it until the pip process exits and no longer imports PyOpenSSL. This isn’t a problem on Linux or macOS or the other *nix clients though. We patch requests as it is today to prevent it from importing simplejson and cryptography for this reason.<br class=""></blockquote><br class="">Does pip use any advanced features in Requests, at least when it comes<br class="">to downloading packages (which is where the bootstrapping issue lies<br class="">AFAIU)? Because at this point it should like you may be better off with<br class="">a simple pure Python HTTP downloader.<br class=""><br class=""></div></div></blockquote><br class=""></div><div>It’s hard to fully answer the question because it sort of depends?</div><div><br class=""></div><div>Could we switch to just like, urllib2 or something? Yea we could, in fact we used to use that and switched to using requests because we had to backport security work around / fixes ourselves (the big one at the time was host name matching/verification) and we were really bad at keeping up with tracking what patches needed applying and when. Switching to requests let us offload that work to the requests team who are doing a phenomenal job at it.</div><div><br class=""></div><div>Beyond that though, getting HTTP right is hard, and pip used to have to try and implement work arounds to either broken or less optimal urllib2 behavior whereas requests generally gets it right for us out of the box.</div><div><br class=""></div><div>Closer to your specific questions about features, we’re using the requests session support to handle connection pooling to speed up downloading (since we don’t need to open a new connection for every download then), the adapter API to handle transparently allowing file:// URLs, the auth framework to handle holding authentication for multiple domains at once, and the third party library cachecontrol to handle our HTTP caching using a browser style cache.</div><div><br class=""></div><div>I suspect (though I’d let him speak for himself) that Cory would rather continue to be sync only than require pip to go back to not using requests.</div><br class=""><div class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class="">—<br class="">Donald Stufft<br class=""></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""></div><br class="Apple-interchange-newline">
</div>
<br class=""></body></html>