BikeMike
unread,Jul 10, 2009, 12:13:27 AM7/10/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Bots Open Source EDI Translator
This is actually an issue with server setup I think, and I don't know
how common it is. I only have the problem with one server out of more
than 10 I have tested.
When the folder on the server contains no files and Bots issues an
"ls" command, the server returns "450 No files found". Since numbers
beginning with 4 are classified as errors (in ftplib) then an
exception is returned and Bots reports a process error.
But this is not really an error. The server should not return the 450
code I don't think, but it's not my server and I can't change it.
I started trying to code around this, by modifying communication.py
# Some servers return 450 error if directory is empty - not a real
error so ignore it
try:
lijst = fnmatch.filter(self.session.nlst(),self.channeldict
['filename'])
except ftplib.error_temp:
print "ftp nlst error ignored"
else:
for fromfilename in lijst: #fetch messages from ftp-server.
This worked, but then I thought of an easier solution. I created an
empty file called "do not delete.txt" on the server. As long as you
don't use *.* as the filename to retrieve, it stays there, and the ls
command is always successful.
I'm not sure if you think a modification is the correct way to go for
this, or if anyone else has this problem?
Kind Regards
Mike