MCPcopy Index your code
hub / github.com/python/cpython / downloadURL

Function downloadURL

Mac/BuildScript/build-installer.py:776–793  ·  view source on GitHub ↗

Download the contents of the url into the file.

(url, fname)

Source from the content-addressed store, hash-verified

774 os.chdir(curdir)
775
776def downloadURL(url, fname):
777 """
778 Download the contents of the url into the file.
779 """
780 fpIn = urllib_request.urlopen(url)
781 fpOut = open(fname, 'wb')
782 block = fpIn.read(10240)
783 try:
784 while block:
785 fpOut.write(block)
786 block = fpIn.read(10240)
787 fpIn.close()
788 fpOut.close()
789 except:
790 try:
791 os.unlink(fname)
792 except OSError:
793 pass
794
795def verifyThirdPartyFile(url, checksum, fname):
796 """

Callers 1

verifyThirdPartyFileFunction · 0.85

Calls 6

openFunction · 0.50
urlopenMethod · 0.45
readMethod · 0.45
writeMethod · 0.45
closeMethod · 0.45
unlinkMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…