Author Olivier.Grisel
Recipients Olivier.Grisel
Date 2013-12-10.13:08:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Here is a simple python program that uses the new forkserver feature introduced in 3.4b1:

import multiprocessing
import os

def do(i):
    print(i, os.getpid())

def test_forkserver():
    mp = multiprocessing.get_context('forkserver')
    mp.Pool(2).map(do, range(3))

if __name__ == "__main__":

When running this using the "python" command everything works as expected.

When running this using the nosetests launcher ("nosetests -s"), I get:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/Python-HEAD/lib/python3.4/multiprocessing/", line 141, in main
  File "/opt/Python-HEAD/lib/python3.4/multiprocessing/", line 252, in import_main_path
  File "<frozen importlib._bootstrap>", line 1051, in init_module_attrs
AttributeError: 'NoneType' object has no attribute 'loader'

Indeed, the spec variable in multiprocessing/'s import_main_path
function is None as the nosetests script is not a regular python module: in particular is does not have a ".py" extension.

If I copy or symlink or renamed the "nosetests" script as "" in the same folder, this works as expected. I am not familiar enough with the importlib machinery to suggest a fix for this bug.

Also there is a typo in the comment: "causing a psuedo fork bomb" => "causing a pseudo fork bomb".

Note: I am running CPython head updated today.
Date User Action Args
2013-12-10 13:08:59Olivier.Griselsetrecipients: + Olivier.Grisel
2013-12-10 13:08:59Olivier.Griselsetmessageid: <>
2013-12-10 13:08:59Olivier.Grisellinkissue19946 messages
2013-12-10 13:08:58Olivier.Griselcreate