Retrieve file by FTP (using urllib)

Fredrik Lundh effbot at telia.com
Fri Feb 11 06:03:09 EST 2000


Oleg Broytmann <phd at phd.russ.ru> wrote:
> What am I doing wrong? And how to use urllib to get files by FTP?

interesting.  they're using a non-standard server,
which seems to implement the FTP protocol a bit
more literally than urllib expects...

full story: urllib issues an NLST command to make
sure the file exists, before starting the download.
however, RFC959 doesn't necessarily allow this:

    [NLST] causes a directory listing to be sent from
    server to user site.  The pathname should specify a
    directory or other system-specific file group descriptor;
    a null argument implies the current directory.

most FTP servers seem to treat NLST commands as
ordinary "ls -l", but this one doesnt.

I'm pretty sure the only reasonable solution is to
remove the offending code from urllib...

</F>





More information about the Python-list mailing list