[Python-Dev] Re: urllib.urlretrieve (original) (raw)
Fredrik Lundh fredrik at pythonware.com
Fri Aug 27 09:45:02 CEST 2004
- Previous message: [Python-Dev] Re: urllib.urlretrieve
- Next message: [Python-Dev] Alternative Implementation for PEP 292: Simple String Substitutions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
David Abrahams wrote:
sourceforge is known to have reliability problems when downloading large files. here's a wget session on my machine (okay, it's not a silent truncation, but SF is clearly not well): Okay, that tells me something... but shouldn't urllib throw an exception in case of a problem... or shouldn't it do something to retry?
from the HTTP speification:
HTTP/1.1 user agents MUST notify the user when an invalid
length is received and detected.
is urllib a user agent? or is that better left to your application?
file, headers = urllib.urlretrieve(...)
if os.path.getsize(file) != int(headers.get("content-length", 0)):
print "oops!"
- Previous message: [Python-Dev] Re: urllib.urlretrieve
- Next message: [Python-Dev] Alternative Implementation for PEP 292: Simple String Substitutions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]