httplib request is slow on read()

John Hunter jdhunter at
Mon Dec 3 19:27:27 EST 2001

I am using httplib to make a direct GET request, and then dumping the
data to file with 

of = open('temp.dat', 'w')
f = h.getfile()
data =
of.write( h.getfile().read() )

where h is the httplib object.

The read() part is really slow.  When I request the same data from my
browser, it loads very quickly, which suggests to me that there may be
a faster way to get this data into the file.

I don't know if read() is waiting for some end of file that is
delayed... or what...

Any suggestions?

John Hunter

More information about the Python-list mailing list