Staging
v0.8.1
v0.8.1
https://github.com/python/cpython
Revision 6cb24a035c5980cab39b6dc5d70762af07293bea authored by Miss Islington (bot) on 09 June 2020, 13:54:54 UTC, committed by GitHub on 09 June 2020, 13:54:54 UTC
"make install" now uses the PLATLIBDIR variable for the destination lib-dynload/ directory when ./configure --with-platlibdir is used. Update --with-platlibdir comment in configure. (cherry picked from commit 51ae31e5b93b986e57a7e18e25f981a6ffcdefb7) Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent 1a819ca
Tip revision: 6cb24a035c5980cab39b6dc5d70762af07293bea authored by Miss Islington (bot) on 09 June 2020, 13:54:54 UTC
bpo-40684: Fix make install for platlibdir=lib64 (GH-20736)
bpo-40684: Fix make install for platlibdir=lib64 (GH-20736)
Tip revision: 6cb24a0
urlretrieve.py
# Simple Python script to download a file. Used as a fallback
# when other more reliable methods fail.
#
from __future__ import print_function
import sys
try:
from requests import get
except ImportError:
try:
from urllib.request import urlretrieve
USING = "urllib.request.urlretrieve"
except ImportError:
try:
from urllib import urlretrieve
USING = "urllib.retrieve"
except ImportError:
print("Python at", sys.executable, "is not suitable",
"for downloading files.", file=sys.stderr)
sys.exit(2)
else:
USING = "requests.get"
def urlretrieve(url, filename):
r = get(url, stream=True)
r.raise_for_status()
with open(filename, 'wb') as f:
for chunk in r.iter_content(chunk_size=1024):
f.write(chunk)
return filename
if __name__ == '__main__':
if len(sys.argv) != 3:
print("Usage: urlretrieve.py [url] [filename]", file=sys.stderr)
sys.exit(1)
URL = sys.argv[1]
FILENAME = sys.argv[2]
print("Downloading from", URL, "to", FILENAME, "using", USING)
urlretrieve(URL, FILENAME)
Computing file changes ...