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