Re: urlretrieve() failing on me



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.
.



Relevant Pages

  • Re: Judge finds that downloads are not necessarily lost sales
    ... downloads not being lost sales is true, then the RIAA is in NO ... If you don't come to the conclusion that downloads directly lead to ...
    (rec.arts.anime.misc)
  • Re: urlretrieve() failing on me
    ... downloads about 40KB before it stops without any error at all. ... on Windows) ... Gabriel Genellina ...     print ...
    (comp.lang.python)
  • Re: AP1121G - cant set to autonomous
    ... with tftp- it downloads not from 10.0.0.2, ... packet from 192.168.22.18 (unable to match to a dhcp scope) ... Then AP reboots. ...     option space ciscoap; ...
    (comp.dcom.sys.cisco)
  • Re: B.R. Deodhar Presents Ragas of India
    ... downloads. ...   I downloaded due to historical significance. ... Here are some published recordings of Prof. Deodhar: ...
    (rec.music.indian.classical)
  • Re: Where Is Download Manager?
    ... Download any file and set it's destination to that Downloads folder. ... and choose the Date Created or Modified column as your sorting ...
    (microsoft.public.windowsxp.general)