[Tutor] ftp socket.error

Reuben reuben.dlink at gmail.com
Fri Sep 11 18:16:54 CEST 2015


Check if the ftp server ip is pinging

Sent from my iPhone

> On 11-Sep-2015, at 9:30 pm, richard kappler <richkappler at gmail.com> wrote:
> 
> I can connect via ftp, but when I try to send a file, I get a no route to
> host error, I don't understand.
> 
> code:
> 
>>>> import ftplib
>>>> from ftplib import FTP
>>>> fBOT = FTP()
>>>> oldfile = '/home/test/DataFeed/input/images/BOT/1.jpg'
>>>> newfile = 'new.jpg'
>>>> oldfile = open('/home/test/DataFeed/input/images/BOT/1.jpg', 'rb')
>>>> fBOT.connect('192.168.2.23', 2021)
> '220 Service ready for new user.'
>>>> fBOT.login('BOT', 'sick')
> '230 User logged in, proceed.'
>>>> fBOT.storbinary('STOR  newfile', oldfile)
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "/usr/lib64/python2.6/ftplib.py", line 452, in storbinary
>    conn = self.transfercmd(cmd)
>  File "/usr/lib64/python2.6/ftplib.py", line 360, in transfercmd
>    return self.ntransfercmd(cmd, rest)[0]
>  File "/usr/lib64/python2.6/ftplib.py", line 326, in ntransfercmd
>    conn = socket.create_connection((host, port), self.timeout)
>  File "/usr/lib64/python2.6/socket.py", line 567, in create_connection
>    raise error, msg
> socket.error: [Errno 113] No route to host
> 
> Any ideas?
> 
> regards, Richard
> 
> -- 
> 
> All internal models of the world are approximate. ~ Sebastian Thrun
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor


More information about the Tutor mailing list