[NEWBIE] ftplib error?

Steve Holden sholden at holdenweb.com
Thu Jan 17 08:49:24 EST 2002


Bruce Dykes" <bkd at graphnet.com> wrote ...
> > > > import ftplib
> > > > hostname = ftplib.FTP("192.168.13.21")
> > >
> > > I agree with the others that the failure may be due a wrong port.
>
> I'd like to assume that a) when I fail to provide a port to the ftp
client,
> it will use the default port, and b) if I fail to provide a port to
> ftplib.FTP() it will use the default port, and c) in the same environment,
> for the same user, that default port will be the same. 8-)
>
Well, port 21 will be used by the ftplib. I haven't come across an FTP
client program that didn't assume port 21 for the control connection, but
there may be some weird envirnment variable setting that's messing things
up.

> But I'll gladly stand corrected if that's an unwarranted assumption.
>
[ ... ]
>
> > The bottom line, however, is that his client isn't connecting. Until he
> can
> > achieve a connection, the rest is just noise, right Bruce?
>
> Not so much noise, as much as not yet relevant, but educational
nonetheless.
> My first step, before I start sniffing ports, is to fire up an ftp server
on
> my own machine, and try to connect to127.0.0.1. If that fails, well,
you'll
> be hearing about this again. Let's hope it doesn't come to that. That
would
> just be too freaky. 8-)
>
Well, I'd still recommend that you hack the ftplib source to go into debug
mode immediately, or separate the creation of the object from the connect()
so you can set debugging before the session begins.

regards
 Steve
--
Consulting, training, speaking: http://www.holdenweb.com/
Python Web Programming: http://pydish.holdenweb.com/pwp/


"





More information about the Python-list mailing list