Message223317
| 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:34 | martin.panter | set | recipients:
+ martin.panter, ncoghlan, eric.araujo, BreamoreBoy, schlamar |
| 2014年07月17日 07:25:34 | martin.panter | set | messageid: <1405581934.08.0.763933346184.issue14285@psf.upfronthosting.co.za> |
| 2014年07月17日 07:25:34 | martin.panter | link | issue14285 messages |
| 2014年07月17日 07:25:33 | martin.panter | create |
|