[NEWBIE] ftplib error?
Bruce Dykes
bkd at graphnet.com
Wed Jan 16 06:34:16 EST 2002
Here's my code:
import ftplib
hostname = ftplib.FTP("192.168.13.21")
hostname.login("joeuser","mydogsname")
hostname.cwd("$SYSTEM.DATA") # see below
hostname_numbers = hostname.retrlines("GET ALARMDATA")
hostname.quit()
print hostname_numbers
# No, really. I'm calling an ftp server on a Tandem, and that's exactly how
'cd' works in a regular interactive ftp session
I'm running Python 2.1 on NT 4. My code above looks amazingly similar to all
the ftplib examples I've seen, except that I'm using 'hostname' instead of
'f' (which *can't* matter...can it?), and I'm using an IP address instead of
a name.
Here's my traceback:
Traceback (most recent call last):
File "C:\Python21\Pythonwin\pywin\framework\scriptutils.py", line 301, in
RunScript
exec codeObject in __main__.__dict__
File "C:\telex\ftp_test.py", line 2, in ?
hostname = ftplib.FTP("192.168.13.21")
File "c:\python21\lib\ftplib.py", line 108, in __init__
self.connect(host)
File "c:\python21\lib\ftplib.py", line 118, in connect
self.sock.connect((self.host, self.port))
File "<string>", line 1, in connect
error: (10061, 'Connection refused')
Is this an authentication failure? That shouldn't be happening because the
interactive ftp session works just fine. Does ftplib not understand that an
IP address is equivalent to a name? That shouldn't be happening either.
What's going on here?
Thanks for your time
Bruce
More information about the Python-list
mailing list