ftp EOF error, thread and process

N

nemo

Hi all,
My code like this raise an EOFError, It happens if I use the Process
module,
while, if I use thread.start_new_thread(ftp.pwd,()), it seems works
well.
And I wondered why.

from ftplib import FTP
import thread
from multiprocessing import Process

if __name__ == '__main__':
ftp = FTP('localhost', 'movie', 'movie')
print ftp.pwd()
p = Process(target = ftp.pwd) # thread.start_new_thread
(ftp.pwd,()),
p.start()
p.join()
 
G

Gabriel Genellina

My code like this raise an EOFError, It happens if I use the Process
module,
while, if I use thread.start_new_thread(ftp.pwd,()), it seems works
well.
And I wondered why.

from ftplib import FTP
import thread
from multiprocessing import Process

if __name__ == '__main__':
ftp = FTP('localhost', 'movie', 'movie')
print ftp.pwd()
p = Process(target = ftp.pwd) # thread.start_new_thread
(ftp.pwd,()),
p.start()
p.join()

You asked the same question last week.
What exactly do you want to do? Using another process in this example is
just not sensible.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top