Nick Coghlan <ncogh...@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue10845>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to