[Twisted-Python] FTP: A little help?
grimmtooth at gmail.com
Fri Mar 10 23:36:04 EST 2006
For no good reason, I've been trying to implement a basic FTP server w/
Twisted 2.2. After a few puzzling exceptions, some custom code, TOSSING the
custom code, and more quality time with the source, I've come to the
conclusion that I need a nudge in the right direction.
Initially, it looks like it should be pretty straightforward (as much as it
ever gets in Twisted anyway :), but it's not working. Here's the code:
from twisted.protocols.ftp import FTPFactory
from twisted.protocols.ftp import FTPRealm
from twisted.cred.portal import Portal
print "Starting FTP server"
p = Portal(FTPRealm('./')) # start up in local dir for giggles
f = FTPFactory(p)
from twisted.internet import reactor
print "FTP Server terminated."
Simple. This raises no exceptions, and appears to be working until I
actually log in.
ftp> open localhost
Connected to elric.
220 Twisted 2.2.0 FTP Server
User (elric:(none)): anonymous
331 Guest login ok, type your email address as password.
530 Sorry, Authentication failed.
The shell it's running from shows no errors or exceptions. So why did my
anonymous login fail?
(I'll wait until I solve that before I tackle the issue of actual "real"
"Ladies and gentlemen, there's nothing to worry about ... but please keep
your heads down."
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Twisted-Python