Re: urlretrieve() failing on me
- From: Robert Dailey <rcdailey@xxxxxxxxx>
- Date: Fri, 5 Jun 2009 17:53:50 -0700 (PDT)
On Jun 5, 10:31 am, Peter Otten <__pete...@xxxxxx> wrote:
Robert Dailey wrote:
On Jun 5, 3:47 am, "Gabriel Genellina" <gagsl-...@xxxxxxxxxxxx> wrote:
En Thu, 04 Jun 2009 23:42:29 -0300, Robert Dailey <rcdai...@xxxxxxxxx>
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.1..."
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
Well I did not post the code because it is fairly complex and its hard
to give you the whole picture without giving you too much code. But
here you go, you get what you ask for:
def Download( self ):
PrintSubStatus( 'Downloading...' )
destination = normalize( '{0}/{1}'.format( self._info.outdir,
self._info.file_ext ) )
print( self._info.url )
print( destination )
urlretrieve( self._info.url, destination )
Both print statements are shown as below:
http://easynews.dl.sourceforge.net/sourceforge/wxwindows/mxMSW-2.8.10.zip
D:\IT\personal\haresvn\temp\mxMSW-2.8.10.zip
I really can't figure out why this isn't working.
.
- Follow-Ups:
- Re: urlretrieve() failing on me
- From: Robert Dailey
- Re: urlretrieve() failing on me
- References:
- urlretrieve() failing on me
- From: Robert Dailey
- Re: urlretrieve() failing on me
- From: Gabriel Genellina
- Re: urlretrieve() failing on me
- From: Robert Dailey
- Re: urlretrieve() failing on me
- From: Peter Otten
- urlretrieve() failing on me
- Prev by Date: Re: MD6 in Python
- Next by Date: Re: Odd closure issue for generators
- Previous by thread: Re: urlretrieve() failing on me
- Next by thread: Re: urlretrieve() failing on me
- Index(es):
Relevant Pages
|