Author ncoghlan
Recipients Olivier.Grisel, brett.cannon, eric.snow, larry, ncoghlan, pitrou, python-dev, sbt
Date 2013-12-15.21:21:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CADiSq7cSk+Tp_6_ELXzZSQZjyK51ZLWTtSjhQ9R-pgEFne_Peg@mail.gmail.com>
In-reply-to <1387138268.34.0.239760945398.issue19946@psf.upfronthosting.co.za>
Content
Scripts (whether in source form or precompiled) work via direct execution,
but all the other execution paths (directories, zipfiles, -m) rely on the
import system (via runpy). multiprocessing has been broken for years in
that regard, hence my old comment about the way it derived the module name
from the file name being problematic (although it only outright *broke*
with submodule execution, and even then you would likely get away with it
if you didn't use relative imports).

Historically, it was a hard problem to solve, since even the parent process
forgot the original name of __main__, but PEP 451 has now fixed that
limitation.

I also have an idea as to what may be wrong with my patch - I'm going to
try adjusting the first early return from _fixup_main_from_name to ensure
that __main__.__spec__ is set correctly.
History
Date User Action Args
2013-12-15 21:21:03ncoghlansetrecipients: + ncoghlan, brett.cannon, pitrou, larry, python-dev, sbt, eric.snow, Olivier.Grisel
2013-12-15 21:21:03ncoghlanlinkissue19946 messages
2013-12-15 21:21:02ncoghlancreate