[issue10845] test_multiprocessing failure under Windows
report at bugs.python.org
Fri Jan 7 05:40:13 CET 2011
Nick Coghlan <ncoghlan at gmail.com> added the comment:
I'm curious as to the results you get running "python -m test.__main__" and "python Lib/test/__main__.py" as well. I suspect both will fail.
Looking at the forking.py code, I think multiprocessing makes some assumptions that are flat out invalid in the presence of the -m switch - there are no guarantees that you can reverse engineer the name of an arbitrary module from the __file__ attribute. (This actually ties in with the current thread on python-ideas about making the real name of the main module readily available - then the parent process could just pass that through the pipe as a "main_name" value and this problem would go away)
In the short term, however, I think multiprocessing just needs to either special case the situation where "main_name" actually *is* __main__ or just drop the assertion across the board.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list