Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 291094 Details for
Bug 428054
urllib and urllib2 also saving headers when using urllib.urlretrieve & urllib2.read
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
python download comparison script
download.py (text/plain), 1.18 KB, created by
Ivo Manca
on 2008-01-08 22:00:46 UTC
(
hide
)
Description:
python download comparison script
Filename:
MIME Type:
Creator:
Ivo Manca
Created:
2008-01-08 22:00:46 UTC
Size:
1.18 KB
patch
obsolete
>#!/usr/bin/env python >import urllib, urllib2, os, commands, sys > >url = sys.argv[1] >filename = "test" > >print "fetching "+url+" with urllib, urllib2 and wget" > >print "+ downloading with urllib" >fnamelib = filename+".urllib" >urllib.urlretrieve(url,fnamelib) > >fslib = os.path.getsize(fnamelib) >md5lib = commands.getoutput("md5sum "+fnamelib) >print "- finnished downloading with urllib." > > >print "+ downloading with urllib2" >fnamelib2 = filename+".urllib2" >fileout = open(fnamelib2,"w") >filein = urllib2.urlopen(url) > >bytes="" > >while True: > bytes = filein.read(10240) > fileout.write(bytes) > if bytes == "": > break >fileout.close() > >fslib2 = str(os.path.getsize(fnamelib2)) >md5lib2 = commands.getoutput("md5sum "+fnamelib2) >print "- finnished downloading with urllib2." > >print "+ downloading with wget" >fnamewget = filename+".wget" > >os.system("wget "+url+" -O "+fnamewget+"> /dev/null 2>&1") >fswget = str(os.path.getsize(fnamewget)) >md5wget = commands.getoutput("md5sum "+fnamewget) > >print "- finnished downloading with wget." > >print "info: " >print >print >print "md5 filename\tfilesize" >print md5lib +"\t"+ str(fslib) >print md5lib2 +"\t"+ str(fslib2) >print md5wget +"\t"+ str(fswget)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 428054
: 291094