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.

Author pitrou
Recipients giampaolo.rodola, pitrou
Date 2009-10-18.21:22:21
SpamBayes Score 5.3745927e-05
Marked as misclassified No
Message-id <1255900945.2.0.567216991168.issue7167@psf.upfronthosting.co.za>
In-reply-to
Content
I have come accross an FTP server which lftp (an Unix command-line
client) handles well but ftplib doesn't. Both ftplib and lftp are
configured to use passive mode (this server apparently doesn't handle
non-passive), but the address sent in response by the server is a
private IP. Here is a wireshark transcript of the FTP conversation done
by lftp:

220 172.29.AAA.BBB FTP server ready

FEAT

211-Features:
 LANG en
 MDTM
 UTF8
 AUTH TLS
 PBSZ
 PROT
 REST STREAM
 SIZE

211 End

LANG

200 Using default language en

OPTS UTF8 ON

200 UTF8 set to on

USER XXXX
331 Password required for ftth_rdvph

PASS XXXX
230 Connexion reussie pour ftth_rdvph

PWD

257 "/" is the current directory

PASV

227 Entering Passive Mode (172,29,AAA,BBB,195,84).

LIST

150 Opening ASCII mode data connection for file list

226 Transfer complete



As you see, lftp had no problem opening a data connection. It probably
notices that the address advertised in response to PASV doesn't respond
(after e.g. a 2s. timeout), and falls back on the host's known address
instead. In contrast, ftplib simply sits while the connection is
attempted and bails out at the end with a connection error.
History
Date User Action Args
2009-10-18 21:22:25pitrousetrecipients: + pitrou, giampaolo.rodola
2009-10-18 21:22:25pitrousetmessageid: <1255900945.2.0.567216991168.issue7167@psf.upfronthosting.co.za>
2009-10-18 21:22:22pitroulinkissue7167 messages
2009-10-18 21:22:21pitroucreate