Process with ftplib

nemo nemokingdom at gmail.com
Fri Dec 26 08:07:30 EST 2008


Hi,all
There seems something wrong when I use multiprocessing.Process with
ftplib,
My ftp class has a connection method like this:
class qftp:
    def __init__(...):
        self.ftp = FTP()
    def connection(self):
        self.ftp.connect(self.addr, self.port)
        self.ftp.login(self.user, self.password)
when i call the method like:
ftp = qftp(host, port, user, password)
ftp.connect()
ftp.pwd()
It works well but when I using the Process module, something seems
wrong:
ftp = qftp(host, port, user, password)
p = multiprocessing.Process(target = ftp.connect)
p.join()
ftp.ftp.pwd()                   #after join, i think a connection has
made, but it throws an exception
This give me a 'NoneType object has no attribute sendall' exception. I
wondered why?



More information about the Python-list mailing list