[NEWBIE] ftplib error?

Bruce Dykes bkd at graphnet.com
Thu Jan 17 07:20:05 EST 2002


> > > 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-)

But I'll gladly stand corrected if that's an unwarranted assumption.

> > > hostname.login("joeuser","mydogsname")
> > > hostname.cwd("$SYSTEM.DATA")    #  see below
> >
> > Is the directory literally $SYSTEM.DATA or is SYSTEM some environment
> > variable? AFAIK, ftplib doesn't support "interpolating" of environment
> > variables.

hehe. Yep. That's the actual string I type to cahnge directories on the
server. Tandems are Funky.

> > > hostname_numbers = hostname.retrlines("GET ALARMDATA")
> >
> > I think, it should be RETR instead of GET? Then, retrlines is not so
> > similar to file.readlines. :-) From help(ftplib.FTP.retrlines):

Thanks...I'm kinda new at this...


> 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-)

bkd





More information about the Python-list mailing list