-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify rustbuild Rust beta downloading. #36666
Simplify rustbuild Rust beta downloading. #36666
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
079b0bd
to
1a06546
Compare
@@ -18,6 +18,7 @@ | |||
import sys | |||
import tarfile | |||
import tempfile | |||
import urllib2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No the urllib2
module is Python 2-only, considering #36509 just landed a week ago I think we should only use Py3k-compatible modules from now on.
This should be enough without introducing six
as an additional dep:
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, didn't realize we supported Python 3, great! Will make the change.
No need to shell out to curl or WebClient when we can just use the urllib2 library built into Python.
1a06546
to
374ace4
Compare
Note that pre-2.7.9 Python does not verify SSL certificates, but curl and WebClient do. Maybe we should warn on old versions of Python? |
Thanks for the PR! This was originally done in Cargo as well (where much of this is from) but was reverted for a few reasons:
Since this is intended to be "the most robust method of downloading we can find" it may not be super necessary to unify everywhere (it seems to work well today). For me the lack of proxy plus the spotty support for https in python is a bit of a deal breaker :( |
Yeah, thought about @sanxiyn's comment this morning and agree this is probably not a desired change. From what I've heard, Python |
No need to shell out to curl or WebClient when we can just use the
urllib2 library built
into Python.