This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: urllib/urllib2 cannot ftp files which are not listable.
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, jjlee, krumms, mozbugbox
Priority: normal Keywords:

Created on 2005-11-15 10:35 by mozbugbox, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (7)
msg26877 - (view) Author: Bugs Fly (mozbugbox) Date: 2005-11-15 10:35
For whatever reason (security, privacy), there are ftp
sites which will not allow ftp list command while
normal downloading can be performed "blindly". This
mostly happens on direct linked ftp urls.

In urllib.py, the ftp wrapper first check with
"self.ftp.nlst(file)" before downloading, thus prevent
the above sites from being useful. From the codes
around, I saw no reason this extra step/check was
performed at all. If the file really did not exist,
RETR would return a suitable error anyway as checked by
the code below.

msg26878 - (view) Author: Bugs Fly (mozbugbox) Date: 2005-11-15 11:37
Logged In: YES 
user_id=1033842

This might be related to bug #635453 but this is a bigger
bug than a directory list is returned. If an existing file
cannot be retrieved, then functionally is totally broken,
there are no work around in this case.



msg26879 - (view) Author: Thomas Lee (krumms) (Python committer) Date: 2005-11-15 13:34
Logged In: YES 
user_id=315535

what's the expected response/error code from the FTP server
if the NLST fails?
msg26880 - (view) Author: Bugs Fly (mozbugbox) Date: 2005-11-17 05:38
Logged In: YES 
user_id=1033842

  File "/usr/lib/python2.4/ftplib.py", line 241, in sendcmd
    return self.getresp()
  File "/usr/lib/python2.4/ftplib.py", line 216, in getresp
    raise error_perm, resp
IOError: [Errno ftp error] [Errno ftp error] 550
tompda_685692_Professional.Palm.OS.Programming.part12.rar:
No such file or directory.
msg26881 - (view) Author: John J Lee (jjlee) Date: 2006-02-06 01:16
Logged In: YES 
user_id=261020

Bug 1281692 reports the same issue for the urllib case, and
includes a reference to the RFC.
msg26882 - (view) Author: John J Lee (jjlee) Date: 2006-04-15 20:06
Logged In: YES 
user_id=261020

Patch 1470976 fixes this bug.
msg26883 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-04-30 09:28
Logged In: YES 
user_id=849994

Fixed by applying said patch.
History
Date User Action Args
2022-04-11 14:56:14adminsetgithub: 42596
2005-11-15 10:35:32mozbugboxcreate