[Patches] [ python-Patches-1470976 ] Fix for urllib/urllib2 ftp bugs 1357260 and 1281692

SourceForge.net noreply at sourceforge.net
Sun Apr 30 11:26:18 CEST 2006


Patches item #1470976, was opened at 2006-04-15 20:03
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1470976&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: None
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: John J Lee (jjlee)
Assigned to: Nobody/Anonymous (nobody)
Summary: Fix for urllib/urllib2 ftp bugs 1357260 and 1281692

Initial Comment:
This fixes 1357260 and 1281692.

As suggested in the initial comment for 1357260, the
patch simply removes the code that does an NLST before
the attempt to actually fetch the file, since some
server operators turn off file listing (presumably in
an attempt to provide increased security of some kind).
 "Easier to ask forgiveness than get permission"
applies to the FTP protocol as much as to Python :-)

FWIW, I verified that this allows retrieval in some
cases where it wasn't previously, using proftpd 1.2.10
(gentoo ebuild r7) with this configuration directive
placed inside the <Anonymous ~ftp></Anonymous> directive:

    <Limit LIST NLST>
      DenyAll
    </Limit>

Without the patch, I get a 450 when doing a urlopen on
files accessible from that server (using either urllib
or urllib2).  With the patch, I can retrieve the files.


----------------------------------------------------------------------

>Comment By: Georg Brandl (gbrandl)
Date: 2006-04-30 09:26

Message:
Logged In: YES 
user_id=849994

Committed in rev. 45819.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1470976&group_id=5470


More information about the Patches mailing list