urllib.getsize()

Oleg Broytmann phd at phd.russ.ru
Fri Nov 19 09:50:23 CET 1999


On Thu, 18 Nov 1999, Skip Montanaro wrote:
>     Gerrit> I've written a function to get the size of a HTTP/FTP url, is it
>     Gerrit> good enough to be put in urllib.py?
> 
> My only worry is that HEAD doesn't always work (for whatever reason having
> to do more with servers than clients).  Would it be better to wrap things in
> a try/except block?  Anyone have a URL that fails with HEAD?

   What is worse, not every server returns Content-Length. I wrote many
CGIs that didn't :)

Oleg.
---- 
    Oleg Broytmann      Foundation for Effective Policies      phd at phd.russ.ru
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list