[Twisted-Python] Ftp client

Michele Petrazzo michele.petrazzo at unipex.it
Wed Aug 3 11:23:56 MDT 2005


Andrew Bennetts wrote:
>>One problem is that if the user has no password, I receive an error [1] 
>>(if I try to connect with a simple ftp client, when I connect to the 
>>server, if it see that I have no password, it connect me without 
>>password request), however if the user _has_ password, the client 
>>connect correctly.
> 
> 
> Before connecting, can you add:
> 
>     FTPClient.debug = True
> 
> Then we can see a full transcript of what's going on.
> 

I add that line, but I can't see any new line except that I already seen

> 
>>Second:
>>if the user _has_ password, so I can connect, I want to send "LIST 
>>status" command, if I use:
>>
>>ftpClient.queueStringCommand("LIST").addCallbacks(success, fail)
>>
>>I receive [2], and if I use:
> 
> 
> Right.  LIST requires a data connection to be established, and directly
> issuing a LIST without arranging for a PASV or PORT command and associated
> connection will fail.
> 

Ok, but what I do with to make it work?

> 
>>fileList = FTPFileListProtocol()
>>d = ftpClient.list(' status ', fileList)
>>d.addCallbacks(showFiles, fail, callbackArgs=(fileList,))
>>
>>I receive [3]
> 
> 
> Can you retry this with latest Twisted from SVN?  There's a bug in error
> reporting and DeferredLists here that's been fixed in SVN that will make
> this much clearer.

Yes. Just update the my two (win and lin) machines.

[1]

> 
> I don't understand why you're passing ' status ' instead of just 'status',
> though.

But, I don't know :)

With this change " status " -> "status" now I don't receive any error!
But what I receive is an empty file list [2] (on all status and recvq 
sub-directory), both case if I change directory with the cwd command and 
call ftpClient.list(".") or, call it with "status/"-"recvq/".
But I know that into that sub-directory there are a lot of files...


[1]
The return are (on both OS):

[Failure instance: Traceback (failure with no frames): 
twisted.internet.defer.FirstError: 
FirstError(<twisted.python.failure.Failure 
twisted.internet.defer.FirstError>, 0)
]

[2]
Processed file listing:
Total: 0 files

Thanks,
Michele




More information about the Twisted-Python mailing list