[issue8094] Multiprocessing infinite loop

Darren Dale report at bugs.python.org
Thu Apr 21 00:45:06 CEST 2011


Darren Dale <dsdale24 at gmail.com> added the comment:

I think I have a similar situation:

C:\Py\Scripts\foo
---
if __name__ == '__main__':
    import bar
    bar.main()

C:\Py\Lib\site-packages\bar.py
---
from multiprocessing import Pool

def task(arg):
    return arg

def main():
    pool = Pool()
    res = pool.apply_async(task, (3.14,))

    print res.get()

if __name__ == '__main__':
    main()


I can run "python bar.py". "python C:\Py\Scripts\foo" yields an infinite stream of errors:

 File "<string>", line 1 in <module>
 File "C:\Python27\lib\multiprocessing\forking.py", line 346, in main
     prepare(preparation_data)
 File "C:\Python27\lib\multiprocessing\forking.py", line 455, in prepare
     file, path_name, etc = imp.find_module(main_name, dirs)
ImportError: No module named foo

This same scheme works fine on linux. Have I just overlooked something simple?

----------
nosy: +dsdale24

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8094>
_______________________________________


More information about the Python-bugs-list mailing list