A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-July/046044.html below:

[Python-Dev] urllib.urlretrieve() and handling 550 errors when reading from FTP

[Python-Dev] urllib.urlretrieve() and handling 550 errors when reading from FTP [Python-Dev] urllib.urlretrieve() and handling 550 errors when reading from FTPBrett C. bac at OCF.Berkeley.EDU
Sun Jul 11 21:08:51 CEST 2004
Guido van Rossum wrote:
[SNIP]
> 
> Why should I have to use a trailing backslash to get a directory
> listing?  That's not in the FTP standard and probably won't work
> everywhere.
> 

It's the way the code is written for the FTP wrapper in urllib; has 
nothing to do with ftp.python.org or FTP.  Basically the code checks to 
see if there is a trailing slash.  If it does it assumes it is a 
directory and thus only requests a listing of the path from the server. 
  Otherwise it tries to get the file.  If that get fails (with a 550) it 
then decides to try getting a listing for the path.  If that works it 
returns that, otherwise it completely fails.

Basically I don't think there is a way to make this work for urllib 
nicely.  If no one has any objections I will just clarify the docs 
stating that if an attempt to get a file fails on a 550 error (and of 
course I will say what that means) it will then try a LIST command and 
if that succeeds that is what is returned.  And if you need more 
fine-grained control then use ftplib.

-Brett
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4