Weird ftplib problem

Joonas keisari_ at hotmail.com
Tue Jan 9 11:37:05 EST 2001


I am using ftplib to transfer a file into a server.

When I run it in IDLE it works fine but when I run it from command line
by typing 'python ftp.py' it gives the following error message.

Traceback (innermost last):
  File "ftp.py" line 2, in ?
    siirto = FTP('ftp.saunalahti.fi')
  File ".\lib\ftplib.py", line 87, in __init__
    self.connect(host)
  File ".\lib\ftplib.py", line 98, in connect
    self.file = self.sock.makefile('r')
_socket.error: No makefile() function has been installed




###########ftp.py##############
from ftplib import FTP
siirto = FTP('ftp.saunalahti.fi')
siirto.set_debuglevel(1)
siirto.login("******","******")
siirto.cwd('public_html')
siirto.storbinary('STOR pic.gif' , open('pic.gif','rb') ,1024)
siirto.quit()
print "it works"
##############################

What could be wrong?

Joonas.



More information about the Python-list mailing list