February 24th, 2006, 02:25 PM
Can't upload file using ftplib on MacOS X 10.3.9 (Python 2.3)
Hi, thanks for listening. I have a small, simple script that runs perfectly on Windows under Python 2.3, but I get socket errors on MacOS X in Python 2.3 . The script simply uploads a file to an ftp server. Here it is:
from ftplib import FTP
FTPSITE = 'nyx10.nyx.net'
USER = 'liquid333'
PW = '**********'
ftp = FTP(FTPSITE) # connect to host, default port
f = open("erase.py", "rb")
ftp.storbinary("STOR erase.py", f)
except socket.error, e:
print "socket error", e
print "something else"
February 24th, 2006, 04:10 PM
I don't see that there should be any problems with the script, do you have a firewall blocking it? Maybe you could post the error for us, is it getting caught in the socket.error clause?
Originally Posted by liquid333
Oh, also use code tags in the future to preserve indentation . You can get details of this in the how to post a question thread at the top of this forum.
Take care .
February 26th, 2006, 12:16 PM
The exact error message (sorry for forgetting to include this) is (61, 'Connection refused'). It is possible it is behind a firewall, I guess. Although I'm not aware of the firewall. There is no special firewall software (installed). I can't say if Mac OS X is running its own firewall. Doubtfull that it is the firewall in the router, because I have the same router in the same configuration on my Windows PC.
Originally Posted by netytan