Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pIDLy does not work with multiprocessing #5

Closed
piyanatk opened this issue Jun 5, 2015 · 3 comments
Closed

pIDLy does not work with multiprocessing #5

piyanatk opened this issue Jun 5, 2015 · 3 comments

Comments

@piyanatk
Copy link

piyanatk commented Jun 5, 2015

I am trying to spawn multiple pidly sessions as child processes with multiprocessing, and it does not work. It might be related to this issue.

from multiprocessing import Pool
import pidly

def run(i):
    print i
    idl = pidly.IDL()
    idl.close()

pool = Pool(4)
pool.map(run, range(10))
pool.close()
pool.join()

if you execute the above scrip, you will get.

0
1
2
3
4
5
Traceback (most recent call last):
  File "test.py", line 10, in <module>
    pool.map(run, range(10))
  File "/data2/piyanat/src/anaconda/lib/python2.7/multiprocessing/pool.py", line 251, in map
    return self.map_async(func, iterable, chunksize).get()
  File "/data2/piyanat/src/anaconda/lib/python2.7/multiprocessing/pool.py", line 567, in get
    raise self._value
ValueError: I/O operation on closed file
6
7
8
9
@anthonyjsmith
Copy link
Owner

No idea I'm afraid!

@piyanatk
Copy link
Author

piyanatk commented Jun 5, 2015

Okay. The problem was related to pexpect/pexpect#86. I had pexpect3.3 installed. After downgrading to 3.2, I was able to run the above codes with no issue.

@anthonyjsmith Do you want to make a note on your README?

@anthonyjsmith
Copy link
Owner

OK, I think I'll close this. Suspect it's too obscure a problem to mention on the README, but people can always find this issue if they end up Googling for the error message...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants