Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > ftplib acting weird

Reply
Thread Tools

ftplib acting weird

 
 
Merrigan
Guest
Posts: n/a
 
      05-04-2007
Hi All,

I have written a little script to upload some files to an ftp folder.
The problem is as follows :

I wrote the script on my windows laptop, and I want to run it from
mylinux server. Everything worked fine so I uploaded it to my linux
machine. Every time I tun the script I get the following error:

************************************************** ************************************************** ***********************

[root@moses ftpsync]# python ftpsync.py
!!!!!!!!!!
The Connection to the Server Could not be established.
Please Check all neccesary settings and run the script again.
Thank you
!!!!!!!!!!
Traceback (most recent call last):
File "ftpsync.py", line 194, in ?
ftplisting()
File "ftpsync.py", line 83, in ftplisting
ftpconn.cwd(remotedir) #This changes to the remote directory
File "/usr/lib64/python2.4/ftplib.py", line 494, in cwd
return self.voidcmd(cmd)
File "/usr/lib64/python2.4/ftplib.py", line 245, in voidcmd
self.putcmd(cmd)
File "/usr/lib64/python2.4/ftplib.py", line 175, in putcmd
self.putline(line)
File "/usr/lib64/python2.4/ftplib.py", line 170, in putline
self.sock.sendall(line)
AttributeError: 'NoneType' object has no attribute 'sendall'
[root@moses ftpsync]#

************************************************** ************************************************** ***********************

When I copy the same piece of scripting and run it from the python
command shell, it works...

what am I doing wrong? I have double checked everything about a
million times, but to no avail.

Blessings!

 
Reply With Quote
 
 
 
 
Carlos Hanson
Guest
Posts: n/a
 
      05-07-2007
On May 4, 3:43 am, Merrigan <(E-Mail Removed)> wrote:
> Hi All,
>
> I have written a little script to upload some files to an ftp folder.
> The problem is as follows :
>
> I wrote the script on my windows laptop, and I want to run it from
> mylinux server. Everything worked fine so I uploaded it to my linux
> machine. Every time I tun the script I get the following error:
>
> ************************************************** ************************************************** ***********************
>
> [root@moses ftpsync]# python ftpsync.py
> !!!!!!!!!!
> The Connection to the Server Could not be established.
> Please Check all neccesary settings and run the script again.
> Thank you
> !!!!!!!!!!
> Traceback (most recent call last):
> File "ftpsync.py", line 194, in ?
> ftplisting()
> File "ftpsync.py", line 83, in ftplisting
> ftpconn.cwd(remotedir) #This changes to the remote directory
> File "/usr/lib64/python2.4/ftplib.py", line 494, in cwd
> return self.voidcmd(cmd)
> File "/usr/lib64/python2.4/ftplib.py", line 245, in voidcmd
> self.putcmd(cmd)
> File "/usr/lib64/python2.4/ftplib.py", line 175, in putcmd
> self.putline(line)
> File "/usr/lib64/python2.4/ftplib.py", line 170, in putline
> self.sock.sendall(line)
> AttributeError: 'NoneType' object has no attribute 'sendall'
> [root@moses ftpsync]#
>
> ************************************************** ************************************************** ***********************
>
> When I copy the same piece of scripting and run it from the python
> command shell, it works...
>
> what am I doing wrong? I have double checked everything about a
> million times, but to no avail.
>
> Blessings!


Can you show the code?

--
Carlos Hanson

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Odd/Weird errors with FTPLib Bakes Python 6 09-15-2009 06:08 AM
ASP.NET acting weird in Windows 2003 server David ASP .Net 5 04-21-2005 04:22 PM
Firefox acting weird maradcliff@UNLISTED.com Firefox 4 11-15-2004 03:16 AM
Hard drive really acting weird Will Smith Computer Support 13 12-18-2003 03:33 AM
NS7.1 -- busted Moz registry? JMC acting weird... Gordon S. Hlavenka Firefox 1 10-31-2003 02:58 PM



Advertisments