Download the contents of the url into the file.
(url, fname)
| 774 | os.chdir(curdir) |
| 775 | |
| 776 | def 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 | |
| 795 | def verifyThirdPartyFile(url, checksum, fname): |
| 796 | """ |