Author martin.panter
Recipients BreamoreBoy, eric.araujo, martin.panter, ncoghlan, schlamar
Date 2014-07-17.07:25:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1405581934.08.0.763933346184.issue14285@psf.upfronthosting.co.za>
In-reply-to
Content
A file called “package/__main__.py” is executed as a script by “python -m package”. See <https://docs.python.org/dev/library/__main__.html>.

I’ve came across this issue myself. You don’t even need the __main__.py file to be doing anything special, as long as the __init__.py raises an ImportError, I think. On Python 3.4 the report is even more convoluted:

/sbin/python3: Error while finding spec for 'package.__main__' (<class 'ImportError'>: No module named 'missing_module'); 'package' is a package and cannot be directly executed

I dunno what “finding spec” means, and packages _can_ be directly executed if they have a __main__ module, so at least the last bit is definitely wrong.
History
Date User Action Args
2014-07-17 07:25:34martin.pantersetrecipients: + martin.panter, ncoghlan, eric.araujo, BreamoreBoy, schlamar
2014-07-17 07:25:34martin.pantersetmessageid: <1405581934.08.0.763933346184.issue14285@psf.upfronthosting.co.za>
2014-07-17 07:25:34martin.panterlinkissue14285 messages
2014-07-17 07:25:33martin.pantercreate