urlretrieve() failing on me
Peter Otten
__peter__ at web.de
Fri Jun 5 11:31:43 EDT 2009
Robert Dailey wrote:
> On Jun 5, 3:47 am, "Gabriel Genellina" <gagsl-... at yahoo.com.ar> wrote:
>> En Thu, 04 Jun 2009 23:42:29 -0300, Robert Dailey <rcdai... at gmail.com>
>> escribió:
>>
>> > Hey guys, try using urlretrieve() in Python 3.0.1 on the following
>> > URL:
>>
>> >http://softlayer.dl.sourceforge.net/sourceforge/wxwindows/wxMSW-2.8.1...
>>
>> > Have it save the ZIP to any destination directory. For me, this only
>> > downloads about 40KB before it stops without any error at all. Any
>> > reason why this isn't working?
>>
>> I could not reproduce it. I downloaded about 300K without error (Python
>> 3.0.1 on Windows)
>>
>> --
>> Gabriel Genellina
>
> Can you show me your test code please?
Here's mine:
$ cat retriever.py
import urllib.request
import os
def report(*args):
print(args)
url = "http://softlayer.dl.sourceforge.net/sourceforge/wxwindows/wxMSW-2.8.10.zip"
filename = url.rsplit("/")[-1]
urllib.request.urlretrieve(url, filename=filename, reporthook=report)
print(os.path.getsize(filename))
$
If you had shown your code in the first place the problem might have been solved by now...
Peter
More information about the Python-list
mailing list