Richard Oudkerk added the comment: > I appear to be somehow getting child processes where __main__.__file__ is > set, but __main__.__spec__ is not.
That seems to be true for the __main__ module even when multiprocessing is not involved. Running a file /tmp/foo.py containing import sys print(sys.modules['__main__'].__spec__, sys.modules['__main__'].__file__) I get output None /tmp/foo.py I am confused by why you would ever want to load by module name rather than file name. What problem would that fix? If the idea is just to support importing a main module without a .py extension, isn't __file__ good enough? ---------- _______________________________________ 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