Process with ftplib
Gabriel Genellina
gagsl-py2 at yahoo.com.ar
Fri Dec 26 09:40:05 EST 2008
En Fri, 26 Dec 2008 11:07:30 -0200, nemo <nemokingdom at gmail.com> escribió:
> There seems something wrong when I use multiprocessing.Process with
> ftplib, [...]
> 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?
After p.join(), the second process has finished. The global variable ftp
isn't shared between them - so it does not reflect the changes made in the
other process.
An introductory article to multiprocessing:
http://www.doughellmann.com/articles/CompletelyDifferent-2007-10-multiprocessing/index.html
--
Gabriel Genellina
More information about the Python-list
mailing list