New submission from Antoine Pitrou <pit...@free.fr>:

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.

----------
components: Library (Lib)
messages: 94226
nosy: giampaolo.rodola, pitrou
priority: normal
severity: normal
status: open
title: Smarter FTP passive mode
type: feature request
versions: Python 2.7, Python 3.2

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7167>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to