Message235692
In some (but not necessarily all) circumstances, the multiprocessing module is now (in 2.7 and 3.x) able to detect the "infinite spawning" behavior described due to unsafe importing of the main module on Windows. The resulting error message looks like this:
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
Hopefully this behavior and the resulting message will both alert developers when such a problem is introduced in a project and communicate to them what the problem is. Giant blinking red letters aside, hopefully this pragmatic solution will do a better job of educating and helping developers notice and deal with such issues.
In the combinatoric explosion of possibilities that combine nosetest-binaries with PyDev with other useful dev tools, if this error message is being suppressed or otherwise not shared with the end user of those tools, that would warrant opening an issue with that tool. |
|
Date |
User |
Action |
Args |
2015-02-10 16:00:19 | davin | set | recipients:
+ davin, amaury.forgeotdarc, pitrou, mu_mind, mattchaput, sbt, Chris.Jones, mdengler |
2015-02-10 16:00:19 | davin | set | messageid: <1423584019.03.0.267345113111.issue11240@psf.upfronthosting.co.za> |
2015-02-10 16:00:19 | davin | link | issue11240 messages |
2015-02-10 16:00:18 | davin | create | |
|